From e2e4c4576d8139057669693f94d37104c65b2555 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Fri, 1 Jun 2018 19:07:53 +0100 Subject: [PATCH] Move database creation into role (sahara) There is no record for why we implement the database creation outside of the role in the playbook, when we could do it inside the role. Implementing it inside the role allows us to reduce the quantity of group_vars duplicated from the role, and allows us to better document the required variables in the role. The delegation can still be done as it is done in the playbook too. In this patch we remove the group_vars which were duplicated from the role, and remove the DB setup tasks as they are no longer required. Change-Id: I2556013f462e5c4bff24beb1b11006e524bab5a2 Depends-On: https://review.openstack.org/571794 --- inventory/group_vars/sahara_all.yml | 2 -- playbooks/os-sahara-install.yml | 16 ++++------------ 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/inventory/group_vars/sahara_all.yml b/inventory/group_vars/sahara_all.yml index 25b4a34e8b..a1c9fc8b6d 100644 --- a/inventory/group_vars/sahara_all.yml +++ b/inventory/group_vars/sahara_all.yml @@ -17,8 +17,6 @@ sahara_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (groups sahara_service_region: "{{ service_region }}" sahara_service_in_ldap: "{{ service_ldap_backend_enabled }}" -sahara_galera_address: "{{ galera_address }}" - # venv fetch configuration sahara_venv_tag: "{{ venv_tag }}" sahara_venv_download_url: "{{ venv_base_download_url }}/sahara-{{ openstack_release }}-{{ ansible_architecture | lower }}.tgz" diff --git a/playbooks/os-sahara-install.yml b/playbooks/os-sahara-install.yml index 21acf64ecc..0a7be9f347 100644 --- a/playbooks/os-sahara-install.yml +++ b/playbooks/os-sahara-install.yml @@ -15,6 +15,9 @@ hosts: sahara_all gather_facts: "{{ osa_gather_facts | default(True) }}" user: root + environment: "{{ deployment_environment_variables | default({}) }}" + tags: + - sahara pre_tasks: - include: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml" @@ -46,14 +49,7 @@ log_dirs: - src: "/openstack/log/{{ inventory_hostname }}-sahara" dest: "/var/log/sahara" - - include: common-tasks/mysql-db-user.yml - static: no - vars: - user_name: "{{ sahara_galera_user }}" - password: "{{ sahara_container_mysql_password }}" - login_host: "{{ sahara_galera_address }}" - db_name: "{{ sahara_galera_database }}" - when: inventory_hostname == groups['sahara_all'][0] + - include: common-tasks/unbound-clients.yml static: no when: @@ -67,7 +63,3 @@ rsyslog_client_log_rotate_file: sahara_log_rotate rsyslog_client_log_dir: "/var/log/sahara" rsyslog_client_config_name: "99-sahara-rsyslog-client.conf" - - environment: "{{ deployment_environment_variables | default({}) }}" - tags: - - sahara