Fix missing /run/resolvconf/resolv.conf in trusty/xenial
Ubuntu 14/16.04 uses links /etc/resolv.conf to /run/resolvconf/resolv.conf. This results in a failure of rsync to copy the contents of the lxc host's resolv.conf contents into the container template, and only recreates the link. This commit adds the necessary files from /run/resolvconf to the container template to allow for proper domain resolution during template modification. The sync command from the tasks/lxc_cache_preparation.yml file now ensures a source exists prior to running the sync. This is needed because of differences in the gate vs what is seen in production. Additionally the item variables in the sync command have been quoted they can not be escaped. Change-Id: I58c9a81306922f9e587e1ed3a7a2693c64bfec3c
This commit is contained in:
parent
f11bbc4f34
commit
64b3a43b94
@ -25,7 +25,12 @@
|
||||
# TODO(evrardjp): replace this with a copy with remote_src: True
|
||||
# when ansible2.0 will be supported
|
||||
- name: Rsyncing files from the LXC host to the container cache
|
||||
command: "rsync -a {{ item }} /var/lib/lxc/LXC_NAME/rootfs{{ item }}"
|
||||
shell: |
|
||||
if [[ -e "{{ item }}" ]]; then
|
||||
rsync -av "{{ item }}" "/var/lib/lxc/LXC_NAME/rootfs{{ item }}"
|
||||
fi
|
||||
args:
|
||||
executable: "/bin/bash"
|
||||
with_items: "{{ lxc_cache_map.copy_from_host }}"
|
||||
tags:
|
||||
- lxc-cache
|
||||
|
@ -44,6 +44,7 @@ lxc_cache_map:
|
||||
- /etc/apt/sources.list
|
||||
- /etc/apt/sources.list.d/
|
||||
- /etc/apt/apt.conf.d/
|
||||
- /run/resolvconf/
|
||||
- /etc/resolvconf/
|
||||
- /etc/resolv.conf
|
||||
- /root/repo.keys
|
||||
|
@ -47,6 +47,7 @@ lxc_cache_map:
|
||||
- /etc/apt/sources.list
|
||||
- /etc/apt/sources.list.d/
|
||||
- /etc/apt/apt.conf.d/
|
||||
- /run/resolvconf/
|
||||
- /etc/resolvconf/
|
||||
- /etc/resolv.conf
|
||||
- /root/repo.keys
|
||||
|
Loading…
x
Reference in New Issue
Block a user