Relocating DB and DB user creation tasks

Revoving the database and database user creation tasks from
the Magnum role and placing them in the extras/os-magnum-install.yml
file.

Change-Id: I73d4906d2559540dd728f9f002512b13e1d1cea3
This commit is contained in:
Chris Hultin
2016-06-15 14:48:22 -05:00
committed by Jesse Pretorius
parent 8b282810b6
commit 03ff822c9f
2 changed files with 32 additions and 31 deletions

View File

@@ -44,6 +44,34 @@
retries: 3
tags:
- ssh-wait
- name: Create Magnum's database tables
mysql_db:
login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}"
login_host: "{{ magnum_galera_address }}"
name: "{{ magnum_galera_database_name }}"
state: "present"
tags:
- magnum-database-setup
- magnum-db-setup
- magnum-setup
- name: Give Magnum database access
mysql_user:
login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}"
login_host: "{{ magnum_galera_address }}"
name: "{{ magnum_galera_user }}"
password: "{{ magnum_galera_password }}"
priv: "{{ magnum_galera_database_name }}.*:ALL"
host: "{{ item }}"
state: "present"
with_items:
- "localhost"
- "%"
tags:
- magnum-database-setup
- magnum-db-setup
- magnum-setup
- name: Sort the rabbitmq servers
dist_sort:
value_to_lookup: "{{ container_name }}"
@@ -72,7 +100,6 @@
- magnum-logs
roles:
- role: "openstack-ansible-magnum"
magnum_galera_address: "{{ galera_address }}"
magnum_venv_tag: "{{ openstack_release }}"
magnum_venv_download_url: "{{ openstack_repo_url }}/venvs/{{ openstack_release }}/{{ ansible_distribution | lower }}/magnum-{{ openstack_release }}.tgz"
tags:
@@ -83,5 +110,9 @@
- "system-crontab-coordination"
vars:
galera_address: "{{ internal_lb_vip_address }}"
magnum_galera_address: "{{ internal_lb_vip_address }}"
magnum_galera_database_name: magnum_service
magnum_galera_user: magnum
ansible_hostname: "{{ container_name }}"
is_metal: "{{ properties.is_metal|default(false) }}"

View File

@@ -13,36 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Create Magnum's database tables
mysql_db:
login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}"
login_host: "{{ magnum_galera_address }}"
name: "{{ magnum_galera_database_name }}"
state: "present"
tags:
- magnum-database-setup
- magnum-db-setup
- magnum-setup
- name: Give Magnum database access
mysql_user:
login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}"
login_host: "{{ magnum_galera_address }}"
name: "{{ magnum_galera_user }}"
password: "{{ magnum_galera_password }}"
priv: "{{ magnum_galera_database_name }}.*:ALL"
host: "{{ item }}"
state: "present"
with_items:
- "localhost"
- "%"
tags:
- magnum-database-setup
- magnum-db-setup
- magnum-setup
- name: Perform a synchronization of the Magnum database
command: "{{ magnum_venv_bin}}/magnum-db-manage upgrade"
sudo: yes