Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve Linting Errors #207

Merged
merged 1 commit into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion roles/rke2_agent/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

- name: RKE2 agent and server tasks
vars:
caller_role_name: agent
rke2_common_caller_role_name: agent
ansible.builtin.include_role:
name: rke2_common
tasks_from: main
Expand Down
4 changes: 2 additions & 2 deletions roles/rke2_common/tasks/add-registry-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
mode: '0640'
owner: root
group: root
when: caller_role_name == "server"
when: rke2_common_caller_role_name == "server"
notify: Restart rke2-server

- name: Add registry configuration file
Expand All @@ -22,5 +22,5 @@
mode: '0640'
owner: root
group: root
when: caller_role_name == "agent"
when: rke2_common_caller_role_name == "agent"
notify: Restart rke2-agent
3 changes: 2 additions & 1 deletion roles/rke2_common/tasks/calculate_rke2_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@

- name: Set rke2_full_version fact
ansible.builtin.set_fact:
rke2_full_version: "{{ rke2_full_version.stdout if ((install_rke2_version is not defined) or (install_rke2_version|length == 0)) else install_rke2_version }}" # yamllint disable-line rule:line-length
rke2_full_version: "{{ rke2_full_version.stdout if ((install_rke2_version is not defined) or
(install_rke2_version | length == 0)) else install_rke2_version }}"

- name: Set dot version
ansible.builtin.shell:
Expand Down
5 changes: 4 additions & 1 deletion roles/rke2_common/tasks/cis-hardening.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,7 @@
- name: Reboot the machine (Wait for 5 min)
ansible.builtin.reboot:
reboot_timeout: 300
when: (sysctl_operation_yum.changed or sysctl_operation_tarball.changed) and rke2_running is defined and rke2_running
when:
- (sysctl_operation_yum.changed or sysctl_operation_tarball.changed)
- rke2_running is defined
- rke2_running
2 changes: 1 addition & 1 deletion roles/rke2_common/tasks/previous_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@

- name: Determine if current version differs what what is being installed
ansible.builtin.set_fact:
installed_rke2_version: "{{installed_rke2_version_tmp.stdout}}"
installed_rke2_version: "{{ installed_rke2_version_tmp.stdout }}"
when: rke2_binary.stat.exists
8 changes: 6 additions & 2 deletions roles/rke2_common/tasks/rpm_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
when:
- not stat_rke2_common_repo.stat.exists
- ansible_facts['os_family'] == "RedHat" or ansible_facts['os_family'] == "Rocky"
- ansible_facts['distribution_major_version'] == "7" or ansible_facts['distribution_major_version'] == "8" or ansible_facts['distribution_major_version'] == "9"
- ansible_facts['distribution_major_version'] == "7" or
ansible_facts['distribution_major_version'] == "8" or
ansible_facts['distribution_major_version'] == "9"

# Does the Rancher RKE2 versioned repo exist already
- name: Check to see if rke2 versioned repo exists
Expand All @@ -38,7 +40,9 @@
when:
- not stat_rke2_common_repo.stat.exists
- ansible_facts['os_family'] == "RedHat" or ansible_facts['os_family'] == "Rocky"
- ansible_facts['distribution_major_version'] == "7" or ansible_facts['distribution_major_version'] == "8" or ansible_facts['distribution_major_version'] == "9"
- ansible_facts['distribution_major_version'] == "7" or
ansible_facts['distribution_major_version'] == "8" or
ansible_facts['distribution_major_version'] == "9"

- name: YUM-Based | Install rke2-server
ansible.builtin.yum:
Expand Down
2 changes: 1 addition & 1 deletion roles/rke2_common/tasks/tarball_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

- name: Set tarball RKE2 version var
ansible.builtin.set_fact:
tarball_rke2_version: "{{tarball_rke2_version_tmp.stdout}}"
tarball_rke2_version: "{{ tarball_rke2_version_tmp.stdout }}"

- name: Determine if current version differs what what is being installed
ansible.builtin.set_fact:
Expand Down
2 changes: 1 addition & 1 deletion roles/rke2_server/tasks/first_server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

- name: Extract the hostname-override parameter from the kubelet process
ansible.builtin.set_fact:
kubelet_hostname_override_parameter: "{{ kubelet_check.stdout |\
kubelet_hostname_override_parameter: "{{ kubelet_check.stdout | \
regex_search('\\s--hostname-override=((([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9]))\\s',\
'\\1') }}"

Expand Down
2 changes: 1 addition & 1 deletion roles/rke2_server/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

- name: RKE2 agent and server tasks
vars:
caller_role_name: server
rke2_common_caller_role_name: server
ansible.builtin.include_role:
name: rke2_common
tasks_from: main
Expand Down
2 changes: 1 addition & 1 deletion roles/rke2_server/tasks/other_servers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

- name: Extract the hostname-override parameter from the kubelet process
ansible.builtin.set_fact:
kubelet_hostname_override_parameter: "{{ kubelet_check.stdout |\
kubelet_hostname_override_parameter: "{{ kubelet_check.stdout | \
regex_search('\\s--hostname-override=((([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9]))\\s',\
'\\1') }}"

Expand Down
Loading