Move database creation into role (magnum)

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/578812
Change-Id: I0d9ecec55ee15c83159a1ea5715241f53823cd32
This commit is contained in:
Jesse Pretorius 2018-06-28 15:05:35 +01:00
parent cc62907734
commit f407d7f078
2 changed files with 6 additions and 16 deletions

View File

@ -23,10 +23,6 @@ magnum_service_adminuri_proto: "{{ openstack_service_adminuri_proto | default(ma
magnum_service_adminurl: "{{ magnum_service_adminuri_proto }}://{{ internal_lb_vip_address }}:{{ magnum_bind_port }}"
magnum_service_region: "{{ service_region }}"
magnum_galera_user: magnum
magnum_galera_database_name: magnum_service
magnum_galera_address: "{{ galera_address }}"
# Ensure that the package state matches the global setting
magnum_package_state: "{{ package_state }}"

View File

@ -19,17 +19,23 @@
- name: Install magnum server
hosts: magnum_all
user: root
environment: "{{ deployment_environment_variables | default({}) }}"
tags:
- magnum
pre_tasks:
- include: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml"
- include: common-tasks/os-log-dir-setup.yml
vars:
log_dirs:
- src: "/openstack/log/{{ inventory_hostname }}-magnum"
dest: "/var/log/magnum"
- include: common-tasks/unbound-clients.yml
static: no
when:
- hostvars['localhost']['resolvconf_enabled'] | bool
- include: common-tasks/oslomsg-rpc-vhost-user.yml
static: no
vars:
@ -39,14 +45,6 @@
when:
- inventory_hostname == groups['magnum_all'][0]
- groups[magnum_oslomsg_rpc_host_group] | length > 0
- include: common-tasks/mysql-db-user.yml
static: no
vars:
user_name: "{{ magnum_galera_user }}"
password: "{{ magnum_galera_password }}"
login_host: "{{ magnum_galera_address }}"
db_name: "{{ magnum_galera_database_name }}"
when: inventory_hostname == groups['magnum_all'][0]
roles:
- role: "os_magnum"
@ -56,7 +54,3 @@
rsyslog_client_log_rotate_file: magnum_log_rotate
rsyslog_client_log_dir: "/var/log/magnum"
rsyslog_client_config_name: "99-magnum-rsyslog-client.conf"
environment: "{{ deployment_environment_variables | default({}) }}"
tags:
- "magnum"