Move database creation into role (aodh)

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/574836
Change-Id: I4c87e2984bf3216a7b419cd31f7105fbb5bb9722
This commit is contained in:
Jesse Pretorius 2018-06-12 19:02:23 +01:00
parent 32aa425076
commit 6b1575c452
2 changed files with 7 additions and 15 deletions

View File

@ -14,10 +14,6 @@
# limitations under the License.
aodh_service_region: "{{ service_region }}"
aodh_galera_user: aodh
aodh_galera_database: aodh
aodh_galera_address: "{{ internal_lb_vip_address }}"
aodh_connection_string: "mysql+pymysql://{{ aodh_galera_user }}:{{ aodh_container_db_password }}@{{ aodh_galera_address }}/{{ aodh_galera_database }}?charset=utf8"
aodh_service_in_ldap: "{{ service_ldap_backend_enabled }}"
aodh_service_publicuri: "{{ openstack_service_publicuri_proto|default(aodh_service_proto) }}://{{ external_lb_vip_address }}:{{ aodh_service_port }}"

View File

@ -17,8 +17,12 @@
hosts: aodh_all
gather_facts: "{{ osa_gather_facts | default(True) }}"
user: root
environment: "{{ deployment_environment_variables | default({}) }}"
tags:
- aodh
pre_tasks:
- include: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml"
- include: common-tasks/oslomsg-rpc-vhost-user.yml
static: no
vars:
@ -28,6 +32,7 @@
when:
- inventory_hostname == groups['aodh_api'][0]
- groups[aodh_oslomsg_rpc_host_group] | length > 0
- include: common-tasks/oslomsg-notify-vhost-user.yml
static: no
vars:
@ -43,18 +48,12 @@
log_dirs:
- src: "/openstack/log/{{ inventory_hostname }}-aodh"
dest: "/var/log/aodh"
- include: common-tasks/mysql-db-user.yml
static: no
vars:
user_name: "{{ aodh_galera_user }}"
password: "{{ aodh_container_db_password }}"
login_host: "{{ aodh_galera_address }}"
db_name: "{{ aodh_galera_database }}"
when: inventory_hostname == groups['aodh_all'][0]
- include: common-tasks/unbound-clients.yml
static: no
when:
- hostvars['localhost']['resolvconf_enabled'] | bool
roles:
- role: "os_aodh"
@ -71,6 +70,3 @@
aodh_rabbitmq_servers: "{{ rabbitmq_servers }}"
aodh_rabbitmq_port: "{{ rabbitmq_port }}"
aodh_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}"
environment: "{{ deployment_environment_variables | default({}) }}"
tags:
- aodh