Merge "Move database creation into role"

This commit is contained in:
Zuul 2018-07-02 09:26:25 +00:00 committed by Gerrit Code Review
commit 7871710edf
3 changed files with 7 additions and 5 deletions

View File

@ -96,6 +96,8 @@ zun_docker_api_version: false
# zun_system_group_gid = <GID>
## Database info
zun_db_setup_host: "{{ ('galera_all' in groups) | ternary(groups['galera_all'][0], 'localhost') }}"
zun_galera_address: "{{ galera_address | default('127.0.0.1') }}"
zun_galera_user: zun
zun_galera_database: zun
zun_db_max_overflow: 10

View File

@ -25,7 +25,7 @@
login_host: "{{ zun_galera_address }}"
name: "{{ zun_galera_database }}"
state: "present"
delegate_to: "{{ groups['galera_all'][0] }}"
delegate_to: "{{ zun_db_setup_host }}"
no_log: True
- name: Grant access to the DB for the service
@ -38,7 +38,8 @@
host: "{{ item }}"
state: "present"
priv: "{{ zun_galera_database }}.*:ALL"
append_privs: "{{ db_append_privs | default(omit) }}"
delegate_to: "{{ groups['galera_all'][0] }}"
with_items: "{{ grant_list | default(['localhost', '%']) }}"
delegate_to: "{{ zun_db_setup_host }}"
with_items:
- "localhost"
- "%"
no_log: True

View File

@ -23,7 +23,6 @@
zun_service_password: secrete
zun_kuryr_service_password: secrete
zun_developer_mode: true
zun_galera_address: "{{ hostvars[groups['galera_all'][0]]['ansible_host'] }}"
zun_rabbitmq_servers: "{{ hostvars[groups['rabbitmq_all'][0]]['ansible_host'] }}"
zun_service_publicuri: "http://{{ hostvars[groups['keystone_all'][0]]['ansible_host'] }}:9517"
zun_service_adminuri: "http://{{ hostvars[groups['keystone_all'][0]]['ansible_host'] }}:9517"