Do not use ‘yes/no’ for boolean values (#11472)

Consistent boolean values in ansible playbooks
This commit is contained in:
Vlad Korolev
2024-08-28 01:30:56 -04:00
committed by GitHub
parent 5c5421e453
commit 9a7b021eb8
162 changed files with 507 additions and 508 deletions

View File

@@ -11,17 +11,17 @@
{% endfor %}
delegate_to: localhost
connection: local
delegate_facts: yes
run_once: yes
delegate_facts: true
run_once: true
- name: Hosts | populate inventory into hosts file
blockinfile:
path: /etc/hosts
block: "{{ hostvars.localhost.etc_hosts_inventory_block }}"
state: "{{ 'present' if populate_inventory_to_hosts_file else 'absent' }}"
create: yes
backup: yes
unsafe_writes: yes
create: true
backup: true
unsafe_writes: true
marker: "# Ansible inventory hosts {mark}"
mode: "0644"
@@ -31,8 +31,8 @@
regexp: ".*{{ apiserver_loadbalancer_domain_name }}$"
line: "{{ loadbalancer_apiserver.address }} {{ apiserver_loadbalancer_domain_name }}"
state: present
backup: yes
unsafe_writes: yes
backup: true
unsafe_writes: true
when:
- populate_loadbalancer_apiserver_to_hosts_file
- loadbalancer_apiserver is defined
@@ -69,8 +69,8 @@
line: "{{ item.key }} {{ item.value | join(' ') }}"
regexp: "^{{ item.key }}.*$"
state: present
backup: yes
unsafe_writes: yes
backup: true
unsafe_writes: true
loop: "{{ etc_hosts_localhosts_dict_target | default({}) | dict2items }}"
# gather facts to update ansible_fqdn