diff --git a/.yamllint b/.yamllint index c2321b0f..b2e05b7f 100644 --- a/.yamllint +++ b/.yamllint @@ -5,8 +5,6 @@ rules: line-length: max: 120 level: warning - truthy: - allowed-values: ['true', 'false', 'yes', 'no'] ignore: | .github/ diff --git a/roles/rke2/defaults/main.yml b/roles/rke2/defaults/main.yml index e47a1402..ed16321c 100644 --- a/roles/rke2/defaults/main.yml +++ b/roles/rke2/defaults/main.yml @@ -20,7 +20,7 @@ rke2_common_yum_repo: baseurl: "https://rpm.rancher.io/rke2/{{ rke2_channel }}/common/centos/$releasever/noarch" gpgcheck: true gpgkey: "https://rpm.rancher.io/public.key" - enabled: yes + enabled: true rke2_versioned_yum_repo: name: "rancher-rke2-v{{ rke2_version_majmin }}" # noqa jinja[spacing] @@ -28,7 +28,7 @@ rke2_versioned_yum_repo: baseurl: "https://rpm.rancher.io/rke2/{{ rke2_channel }}/{{ rke2_version_majmin }}/centos/$releasever/$basearch" gpgcheck: true gpgkey: "https://rpm.rancher.io/public.key" - enabled: yes + enabled: true rke2_kubelet_node_name: - "nodeNameNotFound" rke2_config: {} diff --git a/roles/rke2/tasks/add_ansible_managed_config.yml b/roles/rke2/tasks/add_ansible_managed_config.yml index 29103cd1..cb07f931 100644 --- a/roles/rke2/tasks/add_ansible_managed_config.yml +++ b/roles/rke2/tasks/add_ansible_managed_config.yml @@ -24,7 +24,7 @@ name: "{{ file_destination }}" line: '## This is an Ansible managed file, contents will be overwritten ##' state: present - check_mode: yes + check_mode: true register: ansible_managed_check when: stat_result.stat.exists | bool is true diff --git a/roles/rke2/tasks/calculate_rke2_version.yml b/roles/rke2/tasks/calculate_rke2_version.yml index 12c0712e..7c0a939d 100644 --- a/roles/rke2/tasks/calculate_rke2_version.yml +++ b/roles/rke2/tasks/calculate_rke2_version.yml @@ -85,10 +85,9 @@ when: - rke2_version_rpm | length > 0 - # - name: Describe versions - # ansible.builtin.debug: - # msg: - # - "Full version, with revision indication: {{ rke2_full_version }}" - # # - "Version without revision indication: {{ rke2_version_dot }}" - # - "Major and Minor Only: {{ rke2_version_majmin }}" - # - "RPM Version (tilde): {{ rke2_version_rpm }}" +# - name: Describe versions +# ansible.builtin.debug: +# msg: +# - "Full version, with revision indication: {{ rke2_full_version }}" +# - "Major and Minor Only: {{ rke2_version_majmin }}" +# - "RPM Version (tilde): {{ rke2_version_rpm }}" diff --git a/roles/rke2/tasks/cis_hardening.yml b/roles/rke2/tasks/cis_hardening.yml index dec33eb2..b2d194b2 100644 --- a/roles/rke2/tasks/cis_hardening.yml +++ b/roles/rke2/tasks/cis_hardening.yml @@ -1,7 +1,7 @@ --- - name: CIS MODE - become: yes + become: true when: - (cluster_rke2_config.profile | default("") | regex_search('^cis(-\\d+.\\d+)?$')) or (group_rke2_config.profile | default("") | regex_search('^cis(-\\d+.\\d+)?$')) or @@ -38,7 +38,7 @@ ansible.builtin.copy: src: /usr/local/share/rke2/rke2-cis-sysctl.conf dest: /etc/sysctl.d/60-rke2-cis.conf - remote_src: yes + remote_src: true mode: 0600 register: sysctl_operation_tarball when: diff --git a/roles/rke2/tasks/configure_rke2.yml b/roles/rke2/tasks/configure_rke2.yml index 6036a23a..5673884c 100644 --- a/roles/rke2/tasks/configure_rke2.yml +++ b/roles/rke2/tasks/configure_rke2.yml @@ -4,7 +4,7 @@ ansible.builtin.file: path: /etc/rancher/rke2 state: directory - recurse: yes + recurse: true - name: Run CIS-Hardening Tasks ansible.builtin.include_tasks: cis_hardening.yml diff --git a/roles/rke2/tasks/network_manager_fix.yaml b/roles/rke2/tasks/network_manager_fix.yaml index 95037c33..4e61c1eb 100644 --- a/roles/rke2/tasks/network_manager_fix.yaml +++ b/roles/rke2/tasks/network_manager_fix.yaml @@ -10,7 +10,7 @@ block: | [keyfile] unmanaged-devices=interface-name:cali*;interface-name:flannel* - create: yes + create: true mode: 0600 when: ansible_facts.services["NetworkManager.service"] is defined @@ -31,7 +31,7 @@ - name: Disable service nm-cloud-setup ansible.builtin.systemd: name: nm-cloud-setup.service - enabled: no + enabled: false state: stopped when: ansible_facts.services["nm-cloud-setup.service"] is defined notify: @@ -42,7 +42,7 @@ ansible.builtin.systemd: name: nm-cloud-setup.timer state: stopped - enabled: no + enabled: false when: ansible_facts.services["nm-cloud-setup.service"] is defined notify: - Reload NetworkManager diff --git a/roles/rke2/tasks/pre_reqs.yml b/roles/rke2/tasks/pre_reqs.yml index e6aa81b6..3a47e02e 100644 --- a/roles/rke2/tasks/pre_reqs.yml +++ b/roles/rke2/tasks/pre_reqs.yml @@ -6,7 +6,7 @@ ansible.builtin.systemd: name: firewalld state: stopped - enabled: no + enabled: false when: - ansible_facts.services["firewalld.service"] is defined - ansible_facts.services["firewalld.service"].status != "not-found" @@ -18,7 +18,7 @@ - name: Add server iptables rules ansible.builtin.include_tasks: iptables_rules.yml when: - # - ansible_facts.services["iptables.service"] is defined + # - ansible_facts.services["iptables.service"] is defined - rke2_add_iptables_rules | bool - name: Add fapolicyd rules diff --git a/roles/rke2/tasks/tarball_install.yml b/roles/rke2/tasks/tarball_install.yml index 3247d6ba..8f857bd2 100644 --- a/roles/rke2/tasks/tarball_install.yml +++ b/roles/rke2/tasks/tarball_install.yml @@ -139,7 +139,7 @@ mode: '0644' owner: root group: root - remote_src: yes + remote_src: true when: - inventory_hostname in groups['rke2_servers'] @@ -150,7 +150,7 @@ mode: '0644' owner: root group: root - remote_src: yes + remote_src: true when: - inventory_hostname in groups['rke2_servers'] @@ -161,7 +161,7 @@ mode: '0644' owner: root group: root - remote_src: yes + remote_src: true when: - inventory_hostname in groups.get('rke2_agents', []) @@ -172,13 +172,13 @@ mode: '0644' owner: root group: root - remote_src: yes + remote_src: true when: - inventory_hostname in groups.get('rke2_agents', []) - name: TARBALL | Refreshing systemd unit files ansible.builtin.systemd: - daemon-reload: yes + daemon-reload: true - name: Remove the temp_dir ansible.builtin.file: diff --git a/roles/rke2/tasks/wait_for_rke2.yml b/roles/rke2/tasks/wait_for_rke2.yml index 04ec0d94..ea027d97 100644 --- a/roles/rke2/tasks/wait_for_rke2.yml +++ b/roles/rke2/tasks/wait_for_rke2.yml @@ -7,7 +7,7 @@ ansible.builtin.systemd: name: "{{ service_name }}" state: started - enabled: yes + enabled: true - name: Wait for k8s apiserver ansible.builtin.wait_for: diff --git a/roles/testing/tasks/basic_tests.yml b/roles/testing/tasks/basic_tests.yml index 5eb79a40..d4ff5c5a 100644 --- a/roles/testing/tasks/basic_tests.yml +++ b/roles/testing/tasks/basic_tests.yml @@ -9,7 +9,7 @@ ansible.builtin.lineinfile: path: /etc/rancher/rke2/config.yaml line: "selinux: true" - check_mode: yes + check_mode: true register: test_is_selinux_true - name: Assertions diff --git a/testing.yml b/testing.yml index 8e6c89be..57be9470 100644 --- a/testing.yml +++ b/testing.yml @@ -1,6 +1,6 @@ --- - name: Testing play hosts: all - become: yes + become: true roles: - role: testing