Merge "Move database creation into role"
This commit is contained in:
commit
aee7cf1392
|
@ -55,12 +55,10 @@ blazar_system_comment: blazar system user
|
|||
blazar_system_user_home: "/var/lib/{{ blazar_system_user_name }}"
|
||||
|
||||
## Database credentials
|
||||
blazar_db_name: blazar
|
||||
blazar_db_user: root
|
||||
blazar_db_login_host: ""
|
||||
blazar_db_login_user: ""
|
||||
blazar_db_login_password: ""
|
||||
blazar_db_user_password: ""
|
||||
blazar_db_setup_host: "{{ ('galera_all' in groups) | ternary(groups['galera_all'][0], 'localhost') }}"
|
||||
blazar_galera_address: "{{ galera_address | default('127.0.0.1') }}"
|
||||
blazar_galera_database: blazar
|
||||
blazar_galera_user: blazar
|
||||
|
||||
## Service Type and Data
|
||||
blazar_service_region: RegionOne
|
||||
|
@ -98,10 +96,6 @@ blazar_keystone_auth_plugin: password
|
|||
|
||||
blazar_service_in_ldap: false
|
||||
|
||||
## DB info
|
||||
blazar_galera_database: blazar
|
||||
blazar_galera_user: blazar
|
||||
|
||||
blazar_role_name: admin
|
||||
blazar_bind_address: 0.0.0.0
|
||||
blazar_service_port: 9800
|
||||
|
|
|
@ -14,7 +14,33 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
- name: create blazar database schema
|
||||
- name: Create DB for service
|
||||
mysql_db:
|
||||
login_user: "{{ galera_root_user }}"
|
||||
login_password: "{{ galera_root_password }}"
|
||||
login_host: "{{ blazar_galera_address }}"
|
||||
name: "{{ blazar_galera_database }}"
|
||||
state: "present"
|
||||
delegate_to: "{{ blazar_db_setup_host }}"
|
||||
no_log: True
|
||||
|
||||
- name: Grant access to the DB for the service
|
||||
mysql_user:
|
||||
login_user: "{{ galera_root_user }}"
|
||||
login_password: "{{ galera_root_password }}"
|
||||
login_host: "{{ blazar_galera_address }}"
|
||||
name: "{{ blazar_galera_user }}"
|
||||
password: "{{ blazar_container_mysql_password }}"
|
||||
host: "{{ item }}"
|
||||
state: "present"
|
||||
priv: "{{ blazar_galera_database }}.*:ALL"
|
||||
delegate_to: "{{ blazar_db_setup_host }}"
|
||||
with_items:
|
||||
- "localhost"
|
||||
- "%"
|
||||
no_log: True
|
||||
|
||||
- name: Create blazar database schema
|
||||
command: >
|
||||
{{ blazar_bin }}/blazar-db-manage
|
||||
--config-file {{ blazar_conf_dir }}/blazar.conf upgrade head
|
||||
|
|
|
@ -27,10 +27,6 @@
|
|||
when:
|
||||
- "groups['rabbitmq_all'] is defined"
|
||||
|
||||
- include: common/create-grant-db.yml
|
||||
db_name: "{{ blazar_galera_database }}"
|
||||
db_password: "{{ blazar_container_mysql_password }}"
|
||||
|
||||
roles:
|
||||
- role: "os_blazar"
|
||||
vars_files:
|
||||
|
|
Loading…
Reference in New Issue