From 46e908d3f56480ef3997e188a9f175258ef4eed8 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Fri, 1 Jun 2018 15:57:41 +0100 Subject: [PATCH] Move database creation into role (horizon) 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: Ia82a6890da83e9fa384805e837b969d65cdc4abc Depends-On: https://review.openstack.org/571755 --- playbooks/os-horizon-install.yml | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/playbooks/os-horizon-install.yml b/playbooks/os-horizon-install.yml index 5d86b3076d..c0dcf3a703 100644 --- a/playbooks/os-horizon-install.yml +++ b/playbooks/os-horizon-install.yml @@ -17,6 +17,9 @@ hosts: horizon_all gather_facts: "{{ osa_gather_facts | default(True) }}" user: root + environment: "{{ deployment_environment_variables | default({}) }}" + tags: + - horizon pre_tasks: - include: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml" - include: common-tasks/os-log-dir-setup.yml @@ -24,14 +27,7 @@ log_dirs: - src: "/openstack/log/{{ inventory_hostname }}-horizon" dest: "/var/log/horizon" - - include: common-tasks/mysql-db-user.yml - static: no - vars: - user_name: "{{ horizon_galera_user }}" - password: "{{ horizon_container_mysql_password }}" - login_host: "{{ horizon_galera_address }}" - db_name: "{{ horizon_galera_database }}" - when: inventory_hostname == groups['horizon_all'][0] + - include: common-tasks/unbound-clients.yml static: no when: @@ -48,11 +44,3 @@ rsyslog_client_log_rotate_file: horizon_log_rotate rsyslog_client_log_dir: "/var/log/horizon" rsyslog_client_config_name: "99-horizon-rsyslog-client.conf" - - vars: - horizon_galera_user: horizon - horizon_galera_database: horizon - horizon_galera_address: "{{ galera_address }}" - environment: "{{ deployment_environment_variables | default({}) }}" - tags: - - horizon