Skip to content

Commit

Permalink
yes/no are not bools
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Hanafin authored and Daemonslayer2048 committed Aug 2, 2024
1 parent f84d647 commit b8b580c
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 28 deletions.
2 changes: 0 additions & 2 deletions .yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ rules:
line-length:
max: 120
level: warning
truthy:
allowed-values: ['true', 'false', 'yes', 'no']

ignore: |
.github/
Expand Down
4 changes: 2 additions & 2 deletions roles/rke2/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ 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]
description: "Rancher RKE2 Version"
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: {}
Expand Down
2 changes: 1 addition & 1 deletion roles/rke2/tasks/add_ansible_managed_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
13 changes: 6 additions & 7 deletions roles/rke2/tasks/calculate_rke2_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
4 changes: 2 additions & 2 deletions roles/rke2/tasks/cis_hardening.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion roles/rke2/tasks/configure_rke2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions roles/rke2/tasks/network_manager_fix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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:
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions roles/rke2/tasks/pre_reqs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions roles/rke2/tasks/tarball_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
mode: '0644'
owner: root
group: root
remote_src: yes
remote_src: true
when:
- inventory_hostname in groups['rke2_servers']

Expand All @@ -150,7 +150,7 @@
mode: '0644'
owner: root
group: root
remote_src: yes
remote_src: true
when:
- inventory_hostname in groups['rke2_servers']

Expand All @@ -161,7 +161,7 @@
mode: '0644'
owner: root
group: root
remote_src: yes
remote_src: true
when:
- inventory_hostname in groups.get('rke2_agents', [])

Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion roles/rke2/tasks/wait_for_rke2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion roles/testing/tasks/basic_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion testing.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: Testing play
hosts: all
become: yes
become: true
roles:
- role: testing

0 comments on commit b8b580c

Please sign in to comment.