Skip to content
Snippets Groups Projects
Commit d597f707 authored by ant31's avatar ant31
Browse files

use backup file

parent b81a0642
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
regexp: "^{{ hostvars[item].ansible_default_ipv4.address }} {{ item }}$" regexp: "^{{ hostvars[item].ansible_default_ipv4.address }} {{ item }}$"
line: "{{ hostvars[item].ansible_default_ipv4.address }} {{ item }}" line: "{{ hostvars[item].ansible_default_ipv4.address }} {{ item }}"
state: present state: present
backup: yes
when: hostvars[item].ansible_default_ipv4.address is defined when: hostvars[item].ansible_default_ipv4.address is defined
with_items: groups['all'] with_items: groups['all']
...@@ -14,6 +15,7 @@ ...@@ -14,6 +15,7 @@
regexp: ".*{{ apiserver_loadbalancer_domain_name }}$" regexp: ".*{{ apiserver_loadbalancer_domain_name }}$"
line: "{{ loadbalancer_apiserver.address }} lb-apiserver.kubernetes.local" line: "{{ loadbalancer_apiserver.address }} lb-apiserver.kubernetes.local"
state: present state: present
backup: yes
when: loadbalancer_apiserver is defined and apiserver_loadbalancer_domain_name is defined when: loadbalancer_apiserver is defined and apiserver_loadbalancer_domain_name is defined
- name: clean hosts file - name: clean hosts file
...@@ -21,6 +23,7 @@ ...@@ -21,6 +23,7 @@
dest: /etc/hosts dest: /etc/hosts
regexp: "{{ item }}" regexp: "{{ item }}"
state: absent state: absent
backup: yes
with_items: with_items:
- '^127\.0\.0\.1(\s+){{ inventory_hostname }}.*' - '^127\.0\.0\.1(\s+){{ inventory_hostname }}.*'
- '^::1(\s+){{ inventory_hostname }}.*' - '^::1(\s+){{ inventory_hostname }}.*'
...@@ -46,6 +49,7 @@ ...@@ -46,6 +49,7 @@
src: 01-kube-dns.conf.j2 src: 01-kube-dns.conf.j2
dest: /etc/dnsmasq.d/01-kube-dns.conf dest: /etc/dnsmasq.d/01-kube-dns.conf
mode: 755 mode: 755
backup: yes
notify: notify:
- restart dnsmasq - restart dnsmasq
when: inventory_hostname in groups['kube-master'] when: inventory_hostname in groups['kube-master']
...@@ -64,6 +68,6 @@ ...@@ -64,6 +68,6 @@
mode: 644 mode: 644
- name: disable resolv.conf modification by dhclient - name: disable resolv.conf modification by dhclient
copy: src=dhclient_nodnsupdate dest=/etc/dhcp/dhclient-enter-hooks.d/nodnsupdate mode=u+x copy: src=dhclient_nodnsupdate dest=/etc/dhcp/dhclient-enter-hooks.d/nodnsupdate mode=u+x backup=yes
- meta: flush_handlers - meta: flush_handlers
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment