From d98eb49edc4934ac3a18d49748d2b569e9db7520 Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Tue, 20 Sep 2016 19:11:15 -0500 Subject: [PATCH] Change default log bind mount to be optional 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 --- playbooks/common-tasks/os-lxc-container-setup.yml | 13 +++++++++---- playbooks/inventory/group_vars/all.yml | 3 +++ .../playbooks/deploy-config-changes.yml | 14 ++++++++++++-- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/playbooks/common-tasks/os-lxc-container-setup.yml b/playbooks/common-tasks/os-lxc-container-setup.yml index 1d9a67cc3b..394d4f3168 100644 --- a/playbooks/common-tasks/os-lxc-container-setup.yml +++ b/playbooks/common-tasks/os-lxc-container-setup.yml @@ -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: diff --git a/playbooks/inventory/group_vars/all.yml b/playbooks/inventory/group_vars/all.yml index a60058d54b..6c54c26d05 100644 --- a/playbooks/inventory/group_vars/all.yml +++ b/playbooks/inventory/group_vars/all.yml @@ -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 }}" diff --git a/scripts/upgrade-utilities/playbooks/deploy-config-changes.yml b/scripts/upgrade-utilities/playbooks/deploy-config-changes.yml index a69ff3f8a6..1df901ab62 100644 --- a/scripts/upgrade-utilities/playbooks/deploy-config-changes.yml +++ b/scripts/upgrade-utilities/playbooks/deploy-config-changes.yml @@ -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 }}/../../../"