Merge "Revise container DNS resolution implementation"

This commit is contained in:
Jenkins 2016-08-18 08:49:53 +00:00 committed by Gerrit Code Review
commit eb53486f6a
3 changed files with 27 additions and 9 deletions

View File

@ -45,9 +45,11 @@ lxc_cache_map:
copy_from_host:
- /etc/yum.repos.d/
- /etc/pki/rpm-gpg/
- /etc/resolv.conf
- /etc/systemd/resolved.conf
cache_prep_commands: |
if [ -a /etc/resolv.conf ]; then
mv /etc/resolv.conf /etc/resolv.conf.org
fi
echo "nameserver {{ lxc_net_address }}" > /etc/resolv.conf
yum install -y {{ lxc_cache_packages | join(' ') }}
rm -f /usr/bin/python
ln -s /usr/bin/python2.7 /usr/bin/python
@ -64,6 +66,11 @@ lxc_cache_map:
ln -s /dev/null /etc/systemd/system/proc-sys-fs-binfmt_misc.automount || true
echo -e '{{ lxc_container_default_interfaces }}' | tee /etc/sysconfig/network-scripts/ifcfg-eth0
chage -I -1 -d -1 -m 0 -M 99999 -E -1 root
if [ -a /etc/resolv.conf.org ]; then
mv /etc/resolv.conf.org /etc/resolv.conf
else
rm -f /etc/resolv.conf
fi
lxc_cache_packages:
- ca-certificates

View File

@ -43,11 +43,12 @@ lxc_cache_map:
copy_from_host:
- /etc/apt/sources.list
- /etc/apt/apt.conf.d/
- /run/resolvconf/
- /etc/resolvconf/
- /etc/resolv.conf
- /root/repo.keys
cache_prep_commands: |
if [ -a /etc/resolv.conf ]; then
mv /etc/resolv.conf /etc/resolv.conf.org
fi
echo "nameserver {{ lxc_net_address }}" > /etc/resolv.conf
apt-key add /root/repo.keys
rm /root/repo.keys
export DEBIAN_FRONTEND=noninteractive
@ -71,6 +72,11 @@ lxc_cache_map:
echo -e '{{ lxc_container_default_interfaces }}' | tee /etc/network/interfaces
mkdir -p /etc/network/interfaces.d
chage -I -1 -d -1 -m 0 -M 99999 -E -1 root
if [ -a /etc/resolv.conf.org ]; then
mv /etc/resolv.conf.org /etc/resolv.conf
else
rm -f /etc/resolv.conf
fi
# This forces any modified configurations to remain, and any unmodified configs to be replaced
# ref: http://serverfault.com/questions/259226/automatically-keep-current-version-of-config-files-when-apt-get-install

View File

@ -47,12 +47,12 @@ lxc_cache_map:
copy_from_host:
- /etc/apt/sources.list
- /etc/apt/apt.conf.d/
- /run/resolvconf/
- /etc/resolvconf/
- /etc/resolv.conf
- /etc/systemd/resolved.conf
- /root/repo.keys
cache_prep_commands: |
if [ -a /etc/resolv.conf ]; then
mv /etc/resolv.conf /etc/resolv.conf.org
fi
echo "nameserver {{ lxc_net_address }}" > /etc/resolv.conf
apt-key add /root/repo.keys
rm /root/repo.keys
export DEBIAN_FRONTEND=noninteractive
@ -76,6 +76,11 @@ lxc_cache_map:
echo -e '{{ lxc_container_default_interfaces }}' | tee /etc/network/interfaces
mkdir -p /etc/network/interfaces.d
chage -I -1 -d -1 -m 0 -M 99999 -E -1 root
if [ -a /etc/resolv.conf.org ]; then
mv /etc/resolv.conf.org /etc/resolv.conf
else
rm -f /etc/resolv.conf
fi
# This forces any modified configurations to remain, and any unmodified configs to be replaced
# ref: http://serverfault.com/questions/259226/automatically-keep-current-version-of-config-files-when-apt-get-install