From a63e4a351b41240bf511d5b833378e07dca1a681 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Thu, 28 Jun 2018 14:48:41 +0100 Subject: [PATCH] Move database creation into role (congress) 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. Depends-On: https://review.openstack.org/578800 Change-Id: Ideb2774b8381baba0461220fec78d608b6dcd154 --- inventory/group_vars/congress_all.yml | 5 ----- playbooks/os-congress-install.yml | 13 +++++-------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/inventory/group_vars/congress_all.yml b/inventory/group_vars/congress_all.yml index 3d8f5b9a12..13c049260f 100644 --- a/inventory/group_vars/congress_all.yml +++ b/inventory/group_vars/congress_all.yml @@ -16,11 +16,6 @@ congress_service_region: "{{ service_region }}" congress_service_in_ldap: "{{ service_ldap_backend_enabled }}" -# MariaDB details for the congress service -congress_galera_user: congress -congress_galera_database: congress -congress_galera_address: "{{ galera_address }}" - # Ensure that the package state matches the global setting congress_package_state: "{{ package_state }}" diff --git a/playbooks/os-congress-install.yml b/playbooks/os-congress-install.yml index 2dfce540ab..b5d2bedbe8 100644 --- a/playbooks/os-congress-install.yml +++ b/playbooks/os-congress-install.yml @@ -13,20 +13,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -- name: install congress components +- name: Install congress components hosts: congress_all gather_facts: "{{ gather_facts | default(True) }}" max_fail_percentage: 20 user: root + environment: "{{ deployment_environment_variables | default({}) }}" + tags: + - congress pre_tasks: - include: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml" - - include: common-tasks/mysql-db-user.yml - vars: - user_name: "{{ congress_galera_user }}" - password: "{{ congress_container_mysql_password }}" - login_host: "{{ congress_galera_address }}" - db_name: "{{ congress_galera_database }}" - run_once: yes - name: Configure log directories (on metal) include: common-tasks/os-log-dir-setup.yml @@ -42,6 +38,7 @@ - name: Configure package proxy cache include: common-tasks/package-cache-proxy.yml + roles: - role: "os_congress" - role: "system_crontab_coordination"