Merge "Make the container cache resolvers configurable"

This commit is contained in:
Jenkins 2015-10-23 09:22:44 +00:00 committed by Gerrit Code Review
commit 6e145f3633
4 changed files with 49 additions and 0 deletions

View File

@ -81,6 +81,10 @@ lxc_cache_commands:
- rm -f /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:
- { regexp: "^PermitRootLogin", line: "PermitRootLogin yes" }
- { regexp: "^TCPKeepAlive", line: "TCPKeepAlive yes" }

View File

@ -22,6 +22,42 @@
- lxc-cache
- 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
# lxc_container_create playbook.
- name: Prepare cached image

View File

@ -0,0 +1,3 @@
{% for item in lxc_cache_resolvers %}
{{ item }}
{% endfor %}

View File

@ -275,6 +275,12 @@ if [ ! -d "/etc/openstack_deploy/conf.d" ];then
mkdir -p "/etc/openstack_deploy/conf.d"
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
if [ ${DEPLOY_OPENSTACK} == "no" ]; then
for svc in cinder glance heat horizon neutron nova; do