|
|
@ -68,9 +68,9 @@ |
|
|
|
verbosity: 2 |
|
|
|
|
|
|
|
- name: update container DNS configuration |
|
|
|
shell: lxc-attach -n {{ vm_name }} --clear-env -e -- bash -c "grep '^nameserver {{ hostvars[ext_gateway].ansible_host }}$' /etc/resolv.conf || echo 'nameserver {{ hostvars[ext_gateway].ansible_host }}' > /etc/resolv.conf" |
|
|
|
shell: lxc-attach -n {{ vm_name }} --clear-env -e -- bash -c "grep -Pz1 'domain lilik.it\nnameserver {{ hostvars[ext_gateway].ansible_host }}' /etc/resolv.conf || echo -e 'domain lilik.it\nnameserver {{ hostvars[ext_gateway].ansible_host }}' > /etc/resolv.conf" |
|
|
|
register: container_dns_configuration |
|
|
|
changed_when: "container_dns_configuration.stdout != 'nameserver {{ hostvars[ext_gateway].ansible_host }}'" |
|
|
|
changed_when: container_dns_configuration.stdout != "domain lilik.it\nnameserver {{ hostvars[ext_gateway].ansible_host }}\n\u0000" |
|
|
|
|
|
|
|
- name: update container network configuration |
|
|
|
shell: lxc-attach -n {{ vm_name }} --clear-env -e -- bash -c "grep -F 'iface eth0 inet manual' /etc/network/interfaces || sed -i 's/iface eth0 inet dhcp/iface eth0 inet manual/' /etc/network/interfaces" |
|
|
|