Fix container log bind mount regression

The container bind mount for all logs was being skipped due to a logic
bug. This fixes the bug while also maintaining the functionality to omit
log bind mounts when the variable `default_bind_mount_logs` is set to
"false".

Closes-Bug: #1632818
Change-Id: If9433d6280a3940c25fc0af714313d2caa265df6
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter 2016-10-12 16:11:06 -05:00 committed by Jesse Pretorius (odyssey4me)
parent 52d7ae8397
commit 2252d17c40

View File

@ -27,12 +27,6 @@
# If extra container configurations are desirable set the # If extra container configurations are desirable set the
# "extra_container_config" list to strings containing the options needed. # "extra_container_config" list to strings containing the options needed.
- name: Set default bind mounts
set_fact:
lxc_default_bind_mounts: []
when:
- lxc_default_bind_mounts is undefined
- name: Set default bind mounts (bind var/log) - name: Set default bind mounts (bind var/log)
set_fact: set_fact:
lxc_default_bind_mounts: '{{ lxc_default_bind_mounts | default([{"bind_dir_path": "/var/log", "mount_path": "/openstack/log/{{ inventory_hostname }}"}]) }}' lxc_default_bind_mounts: '{{ lxc_default_bind_mounts | default([{"bind_dir_path": "/var/log", "mount_path": "/openstack/log/{{ inventory_hostname }}"}]) }}'
@ -45,10 +39,9 @@
state: "directory" state: "directory"
with_items: with_items:
- "{{ list_of_bind_mounts | default([]) }}" - "{{ list_of_bind_mounts | default([]) }}"
- "{{ lxc_default_bind_mounts }}" - "{{ lxc_default_bind_mounts | default([]) }}"
delegate_to: "{{ physical_host }}" delegate_to: "{{ physical_host }}"
when: when:
- list_of_bind_mounts is defined
- not is_metal | bool - not is_metal | bool
- name: LXC bind mount directories - name: LXC bind mount directories
@ -58,11 +51,10 @@
[[ ! -d "{{ item['bind_dir_path'] }}" ]] && mkdir -p "{{ item['bind_dir_path'] }}" [[ ! -d "{{ item['bind_dir_path'] }}" ]] && mkdir -p "{{ item['bind_dir_path'] }}"
with_items: with_items:
- "{{ list_of_bind_mounts | default([]) }}" - "{{ list_of_bind_mounts | default([]) }}"
- "{{ lxc_default_bind_mounts }}" - "{{ lxc_default_bind_mounts | default([]) }}"
delegate_to: "{{ physical_host }}" delegate_to: "{{ physical_host }}"
register: _bm register: _bm
when: when:
- list_of_bind_mounts is defined
- not is_metal | bool - not is_metal | bool
- name: Add bind mount configuration to container - name: Add bind mount configuration to container
@ -72,10 +64,9 @@
backup: "true" backup: "true"
with_items: with_items:
- "{{ list_of_bind_mounts | default([]) }}" - "{{ list_of_bind_mounts | default([]) }}"
- "{{ lxc_default_bind_mounts }}" - "{{ lxc_default_bind_mounts | default([]) }}"
delegate_to: "{{ physical_host }}" delegate_to: "{{ physical_host }}"
when: when:
- list_of_bind_mounts is defined
- not is_metal | bool - not is_metal | bool
register: _mc register: _mc