Make the container cache resolvers configurable
This change simply makes it possible for a deployer to change the in container resolvers. In the bootstrap-aio script the resolvers are being set in the user_variables so containers are using the same resolvers as the host. Change-Id: Id7ab3632217c3eb2217a308d7226736a67900da5 Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
parent
e4b5bafe49
commit
8d51f7bafc
@ -81,6 +81,10 @@ lxc_cache_commands:
|
|||||||
- rm -f /usr/bin/python
|
- rm -f /usr/bin/python
|
||||||
- ln -s /usr/bin/python2.7 /usr/bin/python
|
- ln -s /usr/bin/python2.7 /usr/bin/python
|
||||||
|
|
||||||
|
lxc_cache_resolvers:
|
||||||
|
- 'nameserver 8.8.8.8'
|
||||||
|
- 'nameserver 8.8.4.4'
|
||||||
|
|
||||||
lxc_cache_sshd_configuration:
|
lxc_cache_sshd_configuration:
|
||||||
- { regexp: "^PermitRootLogin", line: "PermitRootLogin yes" }
|
- { regexp: "^PermitRootLogin", line: "PermitRootLogin yes" }
|
||||||
- { regexp: "^TCPKeepAlive", line: "TCPKeepAlive yes" }
|
- { regexp: "^TCPKeepAlive", line: "TCPKeepAlive yes" }
|
||||||
|
@ -22,6 +22,42 @@
|
|||||||
- lxc-cache
|
- lxc-cache
|
||||||
- lxc-cache-update
|
- lxc-cache-update
|
||||||
|
|
||||||
|
- name: Update container resolvers
|
||||||
|
template:
|
||||||
|
src: lxc-resolve-base.j2
|
||||||
|
dest: "{{ lxc_container_cache_path }}/{{ item.chroot_path }}/run/resolvconf/resolv.conf"
|
||||||
|
with_items: lxc_container_caches
|
||||||
|
tags:
|
||||||
|
- lxc-cache
|
||||||
|
- lxc-cache-update
|
||||||
|
|
||||||
|
- name: Update container resolvconf base
|
||||||
|
template:
|
||||||
|
src: lxc-resolve-base.j2
|
||||||
|
dest: "{{ lxc_container_cache_path }}/{{ item.chroot_path }}/etc/resolvconf/resolv.conf.d/base"
|
||||||
|
with_items: lxc_container_caches
|
||||||
|
tags:
|
||||||
|
- lxc-cache
|
||||||
|
- lxc-cache-update
|
||||||
|
|
||||||
|
- name: Update container resolvconf tail
|
||||||
|
copy:
|
||||||
|
content: "# Null Tail"
|
||||||
|
dest: "{{ lxc_container_cache_path }}/{{ item.chroot_path }}/etc/resolvconf/resolv.conf.d/tail"
|
||||||
|
with_items: lxc_container_caches
|
||||||
|
tags:
|
||||||
|
- lxc-cache
|
||||||
|
- lxc-cache-update
|
||||||
|
|
||||||
|
- name: Update container resolvconf original
|
||||||
|
copy:
|
||||||
|
content: "# Null original"
|
||||||
|
dest: "{{ lxc_container_cache_path }}/{{ item.chroot_path }}/etc/resolvconf/resolv.conf.d/original"
|
||||||
|
with_items: lxc_container_caches
|
||||||
|
tags:
|
||||||
|
- lxc-cache
|
||||||
|
- lxc-cache-update
|
||||||
|
|
||||||
# This task runs several commands against the cached image to speed up the
|
# This task runs several commands against the cached image to speed up the
|
||||||
# lxc_container_create playbook.
|
# lxc_container_create playbook.
|
||||||
- name: Prepare cached image
|
- name: Prepare cached image
|
||||||
|
3
playbooks/roles/lxc_hosts/templates/lxc-resolve-base.j2
Normal file
3
playbooks/roles/lxc_hosts/templates/lxc-resolve-base.j2
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{% for item in lxc_cache_resolvers %}
|
||||||
|
{{ item }}
|
||||||
|
{% endfor %}
|
@ -275,6 +275,12 @@ if [ ! -d "/etc/openstack_deploy/conf.d" ];then
|
|||||||
mkdir -p "/etc/openstack_deploy/conf.d"
|
mkdir -p "/etc/openstack_deploy/conf.d"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Ensure containers are using the same resolvers as the host
|
||||||
|
RESOLVERS=$(grep nameserver /etc/resolv.conf | awk 'NF { print "\""$0"\""}' | tr '\n' ',' | sed 's/,$//' )
|
||||||
|
if [ ! "$(grep -Rni '^lxc_cache_resolvers' /etc/openstack_deploy/user_variables.yml)" ]; then
|
||||||
|
echo "lxc_cache_resolvers: [$RESOLVERS]" | tee -a /etc/openstack_deploy/user_variables.yml
|
||||||
|
fi
|
||||||
|
|
||||||
# Add tempest settings for particular use-cases
|
# Add tempest settings for particular use-cases
|
||||||
if [ ${DEPLOY_OPENSTACK} == "no" ]; then
|
if [ ${DEPLOY_OPENSTACK} == "no" ]; then
|
||||||
for svc in cinder glance heat horizon neutron nova; do
|
for svc in cinder glance heat horizon neutron nova; do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user