Browse Source

add retrieval of resolv.conf file from container

update_ca_key
Edoardo Putti 8 years ago
parent
commit
15f45accd9
1 changed files with 9 additions and 0 deletions
  1. +9
    -0
      roles/lxc_guest/tasks/main.yaml

+ 9
- 0
roles/lxc_guest/tasks/main.yaml View File

@ -45,6 +45,15 @@
state: "{{ container_state }}"
register: container_running_state
- name: Read container DNS configuration
container_file_read:
name: "{{ vm_name }}"
path: /etc/resolv.conf
register: vm_resolv_conf
- debug:
var: vm_resolv_conf
- 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"
register: container_dns_configuration


Loading…
Cancel
Save