From 24c45ee1dc13c2dfc4d8f032f2243a0e9b836f5a Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Fri, 1 Jun 2018 17:17:49 +0100 Subject: [PATCH] Move database creation into role (ironic) 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: I9ccf73c5797fd5625d8df3c67420cb6724bbe2e2 Depends-On: https://review.openstack.org/571759 --- inventory/group_vars/ironic_all.yml | 3 --- playbooks/os-ironic-install.yml | 20 ++++---------------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/inventory/group_vars/ironic_all.yml b/inventory/group_vars/ironic_all.yml index e13652ea48..fec46811c0 100644 --- a/inventory/group_vars/ironic_all.yml +++ b/inventory/group_vars/ironic_all.yml @@ -15,9 +15,6 @@ ironic_service_name: ironic -ironic_galera_database: ironic -ironic_galera_user: ironic - # Ensure that the package state matches the global setting ironic_package_state: "{{ package_state }}" diff --git a/playbooks/os-ironic-install.yml b/playbooks/os-ironic-install.yml index b4dc5d631f..aeff2e6586 100644 --- a/playbooks/os-ironic-install.yml +++ b/playbooks/os-ironic-install.yml @@ -17,8 +17,12 @@ hosts: ironic_all gather_facts: "{{ osa_gather_facts | default(True) }}" user: root + environment: "{{ deployment_environment_variables | default({}) }}" + tags: + - ironic pre_tasks: - include: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml" + - include: common-tasks/oslomsg-rpc-vhost-user.yml static: no vars: @@ -29,14 +33,6 @@ - inventory_hostname == groups['ironic_all'][0] - groups[ironic_oslomsg_rpc_host_group] | length > 0 - - include: common-tasks/mysql-db-user.yml - static: no - vars: - user_name: "{{ ironic_galera_user }}" - password: "{{ ironic_container_mysql_password }}" - login_host: "{{ ironic_galera_address }}" - db_name: "{{ ironic_galera_database }}" - when: inventory_hostname == groups['ironic_all'][0] - include: common-tasks/unbound-clients.yml static: no when: @@ -53,11 +49,3 @@ rsyslog_client_log_rotate_file: ironic_log_rotate rsyslog_client_log_dir: "/var/log/ironic" rsyslog_client_config_name: "99-ironic-rsyslog-client.conf" - - vars: - ironic_galera_user: ironic - ironic_galera_database: ironic - ironic_galera_address: "{{ galera_address }}" - environment: "{{ deployment_environment_variables | default({}) }}" - tags: - - ironic