Added the DB and DB user create to the plays

All of the database and database user creates have
been removed from the roles into the playbooks. This
allows the roles to be tested independently of the
deployed database and also allows the toles to be
used independently of infrastructure choices made by
the integrated OSA project.

Change-Id: If58e482034a65c0e50241448dbe298a73c1ae71b
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter
2016-05-10 21:58:00 -05:00
committed by Jesse Pretorius (odyssey4me)
parent 2a3c695972
commit cff6ea0533
9 changed files with 262 additions and 39 deletions

View File

@@ -40,34 +40,6 @@
retries: 3
tags:
- ssh-wait
- name: Create DB for Ironic
mysql_db:
login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}"
login_host: "{{ ironic_galera_address }}"
name: "{{ ironic_galera_database }}"
state: "present"
delegate_to: "{{ groups['galera_all'][0] }}"
run_once: true
tags:
- ironic-db-setup
- name: Grant access to the DB for Ironic
mysql_user:
login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}"
login_host: "{{ ironic_galera_address }}"
name: "{{ ironic_galera_user }}"
password: "{{ ironic_galera_password }}"
host: "{{ item }}"
state: "present"
priv: "{{ ironic_galera_database }}.*:ALL"
with_items:
- "localhost"
- "%"
delegate_to: "{{ groups['galera_all'][0] }}"
run_once: true
tags:
- ironic-db-setup
- name: Ensure Rabbitmq vhost for Ironic
rabbitmq_vhost:
name: "{{ ironic_rabbitmq_vhost }}"
@@ -91,6 +63,36 @@
tags:
- ironic-rabbitmq
- ironic-rabbitmq-user
- name: Create DB for Ironic
mysql_db:
login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}"
login_host: "{{ ironic_galera_address }}"
name: "{{ ironic_galera_database }}"
state: "present"
when: inventory_hostname == groups['ironic_all'][0]
delegate_to: "{{ groups['galera_all'][0] }}"
run_once: true
tags:
- mysql-db-setup
- name: Grant access to the DB for Ironic
mysql_user:
login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}"
login_host: "{{ ironic_galera_address }}"
name: "{{ ironic_galera_user }}"
password: "{{ ironic_galera_password }}"
host: "{{ item }}"
state: "present"
priv: "{{ ironic_galera_database }}.*:ALL"
when: inventory_hostname == groups['ironic_all'][0]
delegate_to: "{{ groups['galera_all'][0] }}"
with_items:
- "localhost"
- "%"
run_once: true
tags:
- mysql-db-setup
- name: Sort the rabbitmq servers
dist_sort:
value_to_lookup: "{{ container_name }}"
@@ -124,7 +126,10 @@
tags:
- "system-crontab-coordination"
vars:
galera_address: "{{ internal_lb_vip_address }}"
ansible_hostname: "{{ container_name }}"
ansible_ssh_host: "{{ container_address }}"
ironic_galera_address: "{{ internal_lb_vip_address }}"
is_metal: "{{ properties.is_metal|default(false) }}"
ironic_galera_user: ironic
ironic_galera_database: ironic
ironic_galera_address: "{{ galera_address }}"