Allow custom resolver during cache prep

Allows operator override for the DNS resolver to use during the
cache preparation.

Change-Id: I3ca3f4b8cc342928c8e65d87697660ca8a8f5400
This commit is contained in:
Logan V 2017-02-28 22:55:34 -06:00
parent 39889dfc2b
commit 09dc218995
3 changed files with 10 additions and 2 deletions

View File

@ -102,6 +102,10 @@ lxc_image_compression_ratio: 0
# dest: "/etc/issue"
lxc_container_cache_files: []
# DNS servers to use during cache preparation
lxc_cache_prep_dns:
- "{{ lxc_net_address }}"
# Custom shell commands to run before/after the LXC cache prep process has taken
# place.
lxc_cache_prep_pre_commands: '## pre command skipped ##'

View File

@ -52,7 +52,9 @@ lxc_cache_map:
if [ -a /etc/resolv.conf ]; then
mv /etc/resolv.conf /etc/resolv.conf.org
fi
echo "nameserver {{ lxc_net_address }}" > /etc/resolv.conf
{% for resolver in lxc_cache_prep_dns %}
echo "nameserver {{ resolver }}" >> /etc/resolv.conf
{% endfor %}
yum install -y {{ lxc_cache_distro_packages | join(' ') }}
rm -f /usr/bin/python
ln -s /usr/bin/python2.7 /usr/bin/python

View File

@ -54,7 +54,9 @@ lxc_cache_map:
if [ -a /etc/resolv.conf ]; then
mv /etc/resolv.conf /etc/resolv.conf.org
fi
echo "nameserver {{ lxc_net_address }}" > /etc/resolv.conf
{% for resolver in lxc_cache_prep_dns %}
echo "nameserver {{ resolver }}" >> /etc/resolv.conf
{% endfor %}
apt-key add /root/repo.keys
rm /root/repo.keys
export DEBIAN_FRONTEND=noninteractive