mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-03-09 11:47:47 +03:00
Do not use ‘yes/no’ for boolean values (#11472)
Consistent boolean values in ansible playbooks
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user