Bugfix/11936 - backup: "{{ leave_etc_backup_files }}" (#11937)

* Adding the var: leave_etc_backup_files

* Fix for #11936 - backup: "{{ leave_etc_backup_files }}"
This commit is contained in:
Bas
2025-01-30 15:19:23 +01:00
committed by GitHub
parent 6af849089e
commit 59e1638ae1
6 changed files with 11 additions and 10 deletions

View File

@@ -1,7 +1,8 @@
--- ---
# Set to true to allow pre-checks to fail and continue deployment # Set to true to allow pre-checks to fail and continue deployment
ignore_assert_errors: false ignore_assert_errors: false
# Set to false to disable the backup parameter, set to true to accumulate backups of config files.
leave_etc_backup_files: true
nameservers: [] nameservers: []
cloud_resolver: [] cloud_resolver: []
disable_host_nameservers: false disable_host_nameservers: false

View File

@@ -6,7 +6,7 @@
option: servers option: servers
value: "{{ nameserverentries | join(',') }}" value: "{{ nameserverentries | join(',') }}"
mode: '0600' mode: '0600'
backup: true backup: "{{ leave_etc_backup_files }}"
when: when:
- ('127.0.0.53' not in nameserverentries - ('127.0.0.53' not in nameserverentries
or systemd_resolved_enabled.rc != 0) or systemd_resolved_enabled.rc != 0)
@@ -24,7 +24,7 @@
option: searches option: searches
value: "{{ (default_searchdomains | default([]) + searchdomains) | join(',') }}" value: "{{ (default_searchdomains | default([]) + searchdomains) | join(',') }}"
mode: '0600' mode: '0600'
backup: true backup: "{{ leave_etc_backup_files }}"
notify: Preinstall | update resolvconf for networkmanager notify: Preinstall | update resolvconf for networkmanager
- name: NetworkManager | Add DNS options to NM configuration - name: NetworkManager | Add DNS options to NM configuration
@@ -34,5 +34,5 @@
option: options option: options
value: "ndots:{{ ndots }},timeout:{{ dns_timeout | default('2') }},attempts:{{ dns_attempts | default('2') }}" value: "ndots:{{ ndots }},timeout:{{ dns_timeout | default('2') }},attempts:{{ dns_attempts | default('2') }}"
mode: '0600' mode: '0600'
backup: true backup: "{{ leave_etc_backup_files }}"
notify: Preinstall | update resolvconf for networkmanager notify: Preinstall | update resolvconf for networkmanager

View File

@@ -28,7 +28,7 @@
line: "precedence ::ffff:0:0/96 100" line: "precedence ::ffff:0:0/96 100"
state: present state: present
create: true create: true
backup: true backup: "{{ leave_etc_backup_files }}"
mode: "0644" mode: "0644"
when: when:
- disable_ipv6_dns - disable_ipv6_dns

View File

@@ -25,7 +25,7 @@
block: "{{ hostvars.localhost.etc_hosts_inventory_block }}" block: "{{ hostvars.localhost.etc_hosts_inventory_block }}"
state: "{{ 'present' if populate_inventory_to_hosts_file else 'absent' }}" state: "{{ 'present' if populate_inventory_to_hosts_file else 'absent' }}"
create: true create: true
backup: true backup: "{{ leave_etc_backup_files }}"
unsafe_writes: true unsafe_writes: true
marker: "# Ansible inventory hosts {mark}" marker: "# Ansible inventory hosts {mark}"
mode: "0644" mode: "0644"
@@ -36,7 +36,7 @@
regexp: ".*{{ apiserver_loadbalancer_domain_name }}$" regexp: ".*{{ apiserver_loadbalancer_domain_name }}$"
line: "{{ loadbalancer_apiserver.address }} {{ apiserver_loadbalancer_domain_name }}" line: "{{ loadbalancer_apiserver.address }} {{ apiserver_loadbalancer_domain_name }}"
state: present state: present
backup: true backup: "{{ leave_etc_backup_files }}"
unsafe_writes: true unsafe_writes: true
when: when:
- populate_loadbalancer_apiserver_to_hosts_file - populate_loadbalancer_apiserver_to_hosts_file
@@ -74,7 +74,7 @@
line: "{{ item.key }} {{ item.value | join(' ') }}" line: "{{ item.key }} {{ item.value | join(' ') }}"
regexp: "^{{ item.key }}.*$" regexp: "^{{ item.key }}.*$"
state: present state: present
backup: true backup: "{{ leave_etc_backup_files }}"
unsafe_writes: true unsafe_writes: true
loop: "{{ etc_hosts_localhosts_dict_target | default({}) | dict2items }}" loop: "{{ etc_hosts_localhosts_dict_target | default({}) | dict2items }}"

View File

@@ -10,7 +10,7 @@
create: true create: true
state: present state: present
insertbefore: BOF insertbefore: BOF
backup: true backup: "{{ leave_etc_backup_files }}"
marker: "# Ansible entries {mark}" marker: "# Ansible entries {mark}"
mode: "0644" mode: "0644"
notify: Preinstall | propagate resolvconf to k8s components notify: Preinstall | propagate resolvconf to k8s components

View File

@@ -7,7 +7,7 @@
blockinfile: blockinfile:
path: "{{ dhclientconffile }}" path: "{{ dhclientconffile }}"
state: absent state: absent
backup: true backup: "{{ leave_etc_backup_files }}"
marker: "# Ansible entries {mark}" marker: "# Ansible entries {mark}"
notify: Preinstall | propagate resolvconf to k8s components notify: Preinstall | propagate resolvconf to k8s components