From f77cc7a861117b5fe1a0993bd848b26cd47a385a Mon Sep 17 00:00:00 2001 From: Andy McCrae Date: Thu, 20 Aug 2015 12:14:35 +0100 Subject: [PATCH] Allow a log dir that isn't the "service_name" Galera logs by default to /var/log/mysql_logs these logs are being ignored and not mounted properly on the host server, because the service_name that is used to mount the log directory is "galera" and not "mysql_logs". This patch adds an option to set the log_directory specifically inside the env.d yml files, but defaults to "service_name" when the log_directory option isn't set. This will mean functionality remains unchanged for all services. Additionally, the log_directory has changed to "mysql_logs" for galera containers, to resolve the galera log issue. Change-Id: I18400248da455156dbba31b9c2ff254b58c51673 Closes-Bug: #1486955 --- etc/openstack_deploy/env.d/galera.yml | 1 + .../roles/lxc_container_create/tasks/container_create.yml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/etc/openstack_deploy/env.d/galera.yml b/etc/openstack_deploy/env.d/galera.yml index 33a8d1d52d..9cc1d372d7 100644 --- a/etc/openstack_deploy/env.d/galera.yml +++ b/etc/openstack_deploy/env.d/galera.yml @@ -27,5 +27,6 @@ container_skel: contains: - galera properties: + log_directory: mysql_logs service_name: galera container_release: trusty diff --git a/playbooks/roles/lxc_container_create/tasks/container_create.yml b/playbooks/roles/lxc_container_create/tasks/container_create.yml index 65a08ad895..45cfc74e27 100644 --- a/playbooks/roles/lxc_container_create/tasks/container_create.yml +++ b/playbooks/roles/lxc_container_create/tasks/container_create.yml @@ -97,10 +97,10 @@ name: "{{ inventory_hostname }}" container_command: | mkdir -p /var/backup - mkdir -p /var/log/{{ properties.service_name }} + mkdir -p /var/log/{{ properties.log_directory | default(properties.service_name) }} container_config: - "lxc.mount.entry=/openstack/backup/{{ inventory_hostname }} var/backup none defaults,bind,rw 0 0" - - "lxc.mount.entry=/openstack/log/{{ inventory_hostname }} var/log/{{ properties.service_name }} none defaults,bind,rw 0 0" + - "lxc.mount.entry=/openstack/log/{{ inventory_hostname }} var/log/{{ properties.log_directory | default(properties.service_name) }} none defaults,bind,rw 0 0" - "lxc.aa_profile=lxc-openstack" when: properties.service_name is defined delegate_to: "{{ physical_host }}"