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
This commit is contained in:
Jesse Pretorius 2018-06-01 17:17:49 +01:00
parent 6516b87f92
commit 24c45ee1dc
2 changed files with 4 additions and 19 deletions

View File

@ -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 }}"

View File

@ -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