Skip to content

Commit

Permalink
Change default log bind mount to be optional
Browse files Browse the repository at this point in the history
The default log bind mount will cause service disruption as containers
will need to be rebooted on top of the fact that some services will not
start until log directories are created for the service to write to.
While this is not an issue on greenfield it is a problem on all
upgrades.

Closes-Bug: #1625722
Change-Id: Ic2345012be9d6b46a33da6bd03ccc397d5655a50
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
  • Loading branch information
cloudnull authored and andymcc committed Sep 27, 2016
1 parent ee40a8a commit d98eb49
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
13 changes: 9 additions & 4 deletions playbooks/common-tasks/os-lxc-container-setup.yml
Expand Up @@ -29,10 +29,15 @@

- name: Set default bind mounts
set_fact:
lxc_default_bind_mounts:
- bind_dir_path: "/var/log"
mount_path: "/openstack/log/{{ inventory_hostname }}"
when: lxc_default_bind_mounts is undefined
lxc_default_bind_mounts: []
when:
- lxc_default_bind_mounts is undefined

- name: Set default bind mounts (bind var/log)
set_fact:
lxc_default_bind_mounts: '{{ lxc_default_bind_mounts | default([{"bind_dir_path": "/var/log", "mount_path": "/openstack/log/{{ inventory_hostname }}"}]) }}'
when:
- default_bind_mount_logs | bool

- name: Ensure mount directories exists
file:
Expand Down
3 changes: 3 additions & 0 deletions playbooks/inventory/group_vars/all.yml
Expand Up @@ -26,6 +26,9 @@ ssh_delay: 5
# Options are 'present' and 'latest'
package_state: "latest"

# Set "/var/log" to be a bind mount to the physical host.
default_bind_mount_logs: true

# Ensure that the package state matches the global setting
ceph_client_package_state: "{{ package_state }}"
galera_client_package_state: "{{ package_state }}"
Expand Down
14 changes: 12 additions & 2 deletions scripts/upgrade-utilities/playbooks/deploy-config-changes.yml
Expand Up @@ -38,17 +38,27 @@
with_items:
- "{{ diff_result.stdout_lines }}"
when: diff_result.stdout != ""

- name: Check result for emptiness
debug: msg="All new env.d files are placed in the stock repo. No new changes"
when: diff_result.stdout == ""

- name: Update OpenStack variable names
command: "{{ upgrade_scripts }}/migrate_openstack_vars.py {{ item }} {{ (item | basename)[:-4] }}"
args:
creates: "/etc/openstack_deploy.NEWTON/VARS_MIGRATED_{{ (item | basename)[:-4] }}"
with_fileglob:
- "/etc/openstack_deploy/user_*.yml"

- name: Write vars required for upgrade from Mitaka
lineinfile:
dest: /etc/openstack_deploy/user_variables.yml
regexp: "^{{ item.key }}"
line: "{{ item.key }}: {{ item.value }}"
state: present
with_items:
- key: "default_bind_mount_logs"
value: false
vars:
upgrade_scripts: "{{ playbook_dir }}/../scripts"
repo_root_dir: "{{ playbook_dir }}/../../../"

0 comments on commit d98eb49

Please sign in to comment.