Refactor bootstrap.yml file
Change-Id: I00d2dcb0895548ba169ab85764cf546c2214cbf5
This commit is contained in:
parent
57ee8b3751
commit
7233b45d29
121
ansible/library/kolla_toolbox.py
Normal file
121
ansible/library/kolla_toolbox.py
Normal file
@ -0,0 +1,121 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
# Copyright 2016 99cloud Inc.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
DOCUMENTATION = '''
|
||||||
|
---
|
||||||
|
module: kolla_toolbox
|
||||||
|
short_description: >
|
||||||
|
Module for invoking ansible module in kolla_toolbox container.
|
||||||
|
description:
|
||||||
|
- A module targerting at invoking ansible module in kolla_toolbox
|
||||||
|
container as used by Kolla project.
|
||||||
|
options:
|
||||||
|
module_name:
|
||||||
|
description:
|
||||||
|
- The module name to invoke
|
||||||
|
required: True
|
||||||
|
type: str
|
||||||
|
module_args:
|
||||||
|
description:
|
||||||
|
- The module args use by the module
|
||||||
|
required: False
|
||||||
|
type: str or dict
|
||||||
|
author: Jeffrey Zhang
|
||||||
|
'''
|
||||||
|
|
||||||
|
EXAMPLES = '''
|
||||||
|
- hosts: controller
|
||||||
|
tasks:
|
||||||
|
- name: Ensure the direct absent
|
||||||
|
kolla_toolbox:
|
||||||
|
module_name: file
|
||||||
|
module_args: path=/tmp/a state=absent
|
||||||
|
- name: Create mysql database
|
||||||
|
kolla_toolbox:
|
||||||
|
module_name: mysql_db
|
||||||
|
module_args:
|
||||||
|
login_host: 192.168.1.10
|
||||||
|
login_user: root
|
||||||
|
login_password: admin
|
||||||
|
name: testdb
|
||||||
|
'''
|
||||||
|
|
||||||
|
|
||||||
|
import docker
|
||||||
|
import json
|
||||||
|
import re
|
||||||
|
|
||||||
|
|
||||||
|
JSON_REG = re.compile('^(?P<host>\w+) \| (?P<status>\w+)!? =>(?P<stdout>.*)$',
|
||||||
|
re.MULTILINE | re.DOTALL)
|
||||||
|
NON_JSON_REG = re.compile(('^(?P<host>\w+) \| (?P<status>\w+)!? \| '
|
||||||
|
'rc=(?P<exit_code>\d+) >>\n(?P<stdout>.*)\n$'),
|
||||||
|
re.MULTILINE | re.DOTALL)
|
||||||
|
|
||||||
|
|
||||||
|
def gen_commandline(params):
|
||||||
|
command = ['ansible', 'localhost']
|
||||||
|
if params.get('module_name'):
|
||||||
|
command.extend(['-m', params.get('module_name')])
|
||||||
|
if params.get('module_args'):
|
||||||
|
module_args = params.get('module_args')
|
||||||
|
if isinstance(module_args, dict):
|
||||||
|
module_args = ' '.join("{}='{}'".format(key, value)
|
||||||
|
for key, value in module_args.items())
|
||||||
|
command.extend(['-a', module_args])
|
||||||
|
return command
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
specs = dict(
|
||||||
|
module_name=dict(type='str'),
|
||||||
|
module_args=dict(type='str')
|
||||||
|
)
|
||||||
|
module = AnsibleModule(argument_spec=specs, bypass_checks=True)
|
||||||
|
client = docker.Client()
|
||||||
|
command_line = gen_commandline(module.params)
|
||||||
|
kolla_toolbox = client.containers(all=True,
|
||||||
|
filters=dict(name='kolla_toolbox'))
|
||||||
|
if not kolla_toolbox:
|
||||||
|
module.fail_json(msg='Can not find kolla_toolbox container in target')
|
||||||
|
kolla_toolbox = kolla_toolbox[0]
|
||||||
|
if kolla_toolbox['State'] != 'running':
|
||||||
|
module.fail_json(msg='kolla_toolbox container is not running')
|
||||||
|
|
||||||
|
job = client.exec_create(kolla_toolbox, command_line)
|
||||||
|
output = client.exec_start(job)
|
||||||
|
|
||||||
|
for exp in [JSON_REG, NON_JSON_REG]:
|
||||||
|
m = exp.match(output)
|
||||||
|
if m:
|
||||||
|
inner_output = m.groupdict().get('stdout')
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
module.fail_json(
|
||||||
|
msg='Can not parse the inner module output: %s' % output)
|
||||||
|
|
||||||
|
ret = dict()
|
||||||
|
try:
|
||||||
|
ret = json.loads(inner_output)
|
||||||
|
except ValueError:
|
||||||
|
ret['stdout'] = inner_output
|
||||||
|
|
||||||
|
module.exit_json(**ret)
|
||||||
|
|
||||||
|
|
||||||
|
from ansible.module_utils.basic import * # noqa
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
@ -1,41 +1,32 @@
|
|||||||
---
|
---
|
||||||
- name: Creating aodh database
|
- name: Creating aodh database
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_db
|
module_name: mysql_db
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ aodh_database_name }}'"
|
login_password: "{{ database_password }}"
|
||||||
|
name: "{{ aodh_database_name }}"
|
||||||
register: database
|
register: database
|
||||||
changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['aodh-api'][0] }}"
|
delegate_to: "{{ groups['aodh-api'][0] }}"
|
||||||
|
|
||||||
- name: Reading json from variable
|
|
||||||
set_fact:
|
|
||||||
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
|
|
||||||
- name: Creating aodh database user and setting permissions
|
- name: Creating aodh database user and setting permissions
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_user
|
module_name: mysql_user
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ aodh_database_name }}'
|
login_password: "{{ database_password }}"
|
||||||
password='{{ aodh_database_password }}'
|
name: "{{ aodh_database_name }}"
|
||||||
host='%'
|
password: "{{ aodh_database_password }}"
|
||||||
priv='{{ aodh_database_name }}.*:ALL'
|
host: "%"
|
||||||
append_privs='yes'"
|
priv: "{{ aodh_database_name }}.*:ALL"
|
||||||
register: database_user_create
|
append_privs: "yes"
|
||||||
changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database_user_create.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['aodh-api'][0] }}"
|
delegate_to: "{{ groups['aodh-api'][0] }}"
|
||||||
|
|
||||||
- include: bootstrap_service.yml
|
- include: bootstrap_service.yml
|
||||||
when: database_created
|
when: database.changed
|
||||||
|
@ -1,41 +1,32 @@
|
|||||||
---
|
---
|
||||||
- name: Creating barbican database
|
- name: Creating barbican database
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_db
|
module_name: mysql_db
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ barbican_database_name }}'"
|
login_password: "{{ database_password }}"
|
||||||
|
name: "{{ barbican_database_name }}"
|
||||||
register: database
|
register: database
|
||||||
changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['barbican-api'][0] }}"
|
delegate_to: "{{ groups['barbican-api'][0] }}"
|
||||||
|
|
||||||
- name: Reading json from variable
|
|
||||||
set_fact:
|
|
||||||
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
|
|
||||||
- name: Creating barbican database user and setting permissions
|
- name: Creating barbican database user and setting permissions
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_user
|
module_name: mysql_user
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ barbican_database_name }}'
|
login_password: "{{ database_password }}"
|
||||||
password='{{ barbican_database_password }}'
|
name: "{{ barbican_database_name }}"
|
||||||
host='%'
|
password: "{{ barbican_database_password }}"
|
||||||
priv='{{ barbican_database_name }}.*:ALL'
|
host: "%"
|
||||||
append_privs='yes'"
|
priv: "{{ barbican_database_name }}.*:ALL"
|
||||||
register: database_user_create
|
append_privs: "yes"
|
||||||
changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database_user_create.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['barbican-api'][0] }}"
|
delegate_to: "{{ groups['barbican-api'][0] }}"
|
||||||
|
|
||||||
- include: bootstrap_service.yml
|
- include: bootstrap_service.yml
|
||||||
when: database_created
|
when: database.changed
|
||||||
|
@ -11,13 +11,14 @@
|
|||||||
- ceilometer_database_type == "mongodb"
|
- ceilometer_database_type == "mongodb"
|
||||||
|
|
||||||
- name: Checking Ceilometer mysql database
|
- name: Checking Ceilometer mysql database
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_db
|
module_name: mysql_db
|
||||||
-a "login_host='{{ ceilometer_database_mysql_address }}'
|
module_args:
|
||||||
login_port='{{ ceilometer_database_port }}'
|
login_host: "{{ ceilometer_database_mysql_address }}"
|
||||||
login_user='{{ ceilometer_database_user }}'
|
login_port: "{{ ceilometer_database_port }}"
|
||||||
login_password='{{ ceilometer_database_password }}'
|
login_user: "{{ ceilomter_database_user }}"
|
||||||
name='{{ ceilometer_database_name }}'"
|
login_password: "{{ ceilometer_database_password }}"
|
||||||
|
name: "{{ ceilometer_database_name }}"
|
||||||
register: mysql_access
|
register: mysql_access
|
||||||
failed_when: False
|
failed_when: False
|
||||||
changed_when: False
|
changed_when: False
|
||||||
@ -26,17 +27,15 @@
|
|||||||
- ceilometer_database_type == "mysql"
|
- ceilometer_database_type == "mysql"
|
||||||
|
|
||||||
- name: Creating Ceilometer mysql database
|
- name: Creating Ceilometer mysql database
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_db
|
module_name: mysql_db
|
||||||
-a "login_host='{{ ceilometer_database_mysql_address }}'
|
module_args:
|
||||||
login_port='{{ ceilometer_database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ ceilometer_database_name }}'"
|
login_password: "{{ database_password }}"
|
||||||
|
name: "{{ ceilometer_database_name }}"
|
||||||
register: mysql_ceilometer_database
|
register: mysql_ceilometer_database
|
||||||
changed_when: "{{ mysql_ceilometer_database.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(mysql_ceilometer_database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: mysql_ceilometer_database.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['ceilometer-api'][0] }}"
|
delegate_to: "{{ groups['ceilometer-api'][0] }}"
|
||||||
when:
|
when:
|
||||||
@ -44,21 +43,18 @@
|
|||||||
- "'FAILED' in mysql_access.stdout"
|
- "'FAILED' in mysql_access.stdout"
|
||||||
|
|
||||||
- name: Creating Ceilometer database user and setting permissions
|
- name: Creating Ceilometer database user and setting permissions
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_user
|
module_name: mysql_user
|
||||||
-a "login_host='{{ ceilometer_database_mysql_address }}'
|
module_args:
|
||||||
login_port='{{ ceilometer_database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ ceilometer_database_name }}'
|
login_password: "{{ database_password }}"
|
||||||
password='{{ ceilometer_database_password }}'
|
name: "{{ ceilometer_database_name }}"
|
||||||
host='%'
|
password: "{{ ceilometer_database_password }}"
|
||||||
priv='{{ ceilometer_database_name }}.*:ALL'
|
host: "%"
|
||||||
append_privs='yes'"
|
priv: "{{ ceilometer_database_name }}.*:ALL"
|
||||||
register: database_user_create
|
append_privs: "yes"
|
||||||
changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database_user_create.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['ceilometer-api'][0] }}"
|
delegate_to: "{{ groups['ceilometer-api'][0] }}"
|
||||||
when:
|
when:
|
||||||
@ -69,5 +65,5 @@
|
|||||||
# NOTE(vbel): bootstrapping of mysql db for ceilometer is idempotent
|
# NOTE(vbel): bootstrapping of mysql db for ceilometer is idempotent
|
||||||
- include: bootstrap_service.yml
|
- include: bootstrap_service.yml
|
||||||
when: ((ceilometer_database_type == "mongodb" and mongodb_ceilometer_database.changed)
|
when: ((ceilometer_database_type == "mongodb" and mongodb_ceilometer_database.changed)
|
||||||
or ceilometer_database_type == "mysql"
|
or (ceilometer_database_type == "mysql" and mysql_ceilometer_database.changed )
|
||||||
or ceilometer_database_type == "gnocchi")
|
or ceilometer_database_type == "gnocchi")
|
||||||
|
@ -1,41 +1,32 @@
|
|||||||
---
|
---
|
||||||
- name: Creating Cinder database
|
- name: Creating Cinder database
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_db
|
module_name: mysql_db
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ cinder_database_name }}'"
|
login_password: "{{ database_password }}"
|
||||||
|
name: "{{ cinder_database_name }}"
|
||||||
register: database
|
register: database
|
||||||
changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['cinder-api'][0] }}"
|
delegate_to: "{{ groups['cinder-api'][0] }}"
|
||||||
|
|
||||||
- name: Reading json from variable
|
|
||||||
set_fact:
|
|
||||||
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
|
|
||||||
- name: Creating Cinder database user and setting permissions
|
- name: Creating Cinder database user and setting permissions
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_user
|
module_name: mysql_user
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ cinder_database_name }}'
|
login_password: "{{ database_password }}"
|
||||||
password='{{ cinder_database_password }}'
|
name: "{{ cinder_database_name }}"
|
||||||
host='%'
|
password: "{{ cinder_database_password }}"
|
||||||
priv='{{ cinder_database_name }}.*:ALL'
|
host: "%"
|
||||||
append_privs='yes'"
|
priv: "{{ cinder_database_name }}.*:ALL"
|
||||||
register: database_user_create
|
append_privs: "yes"
|
||||||
changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database_user_create.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['cinder-api'][0] }}"
|
delegate_to: "{{ groups['cinder-api'][0] }}"
|
||||||
|
|
||||||
- include: bootstrap_service.yml
|
- include: bootstrap_service.yml
|
||||||
when: database_created
|
when: database.changed
|
||||||
|
@ -1,41 +1,32 @@
|
|||||||
---
|
---
|
||||||
- name: Creating Cloudkitty database
|
- name: Creating Cloudkitty database
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_db
|
module_name: mysql_db
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ cloudkitty_database_name }}'"
|
login_password: "{{ database_password }}"
|
||||||
|
name: "{{ cloudkitty_database_name }}"
|
||||||
register: database
|
register: database
|
||||||
changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['cloudkitty-api'][0] }}"
|
delegate_to: "{{ groups['cloudkitty-api'][0] }}"
|
||||||
|
|
||||||
- name: Reading json from variable
|
|
||||||
set_fact:
|
|
||||||
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
|
|
||||||
- name: Creating Cloudkitty database user and setting permissions
|
- name: Creating Cloudkitty database user and setting permissions
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_user
|
module_name: mysql_user
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ cloudkitty_database_name }}'
|
login_password: "{{ database_password }}"
|
||||||
password='{{ cloudkitty_database_password }}'
|
name: "{{ cloudkitty_database_name }}"
|
||||||
host='%'
|
password: "{{ cloudkitty_database_password }}"
|
||||||
priv='{{ cloudkitty_database_name }}.*:ALL'
|
host: "%"
|
||||||
append_privs='yes'"
|
priv: "{{ cloudkitty_database_name }}.*:ALL"
|
||||||
register: database_user_create
|
append_privs: "yes"
|
||||||
changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database_user_create.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['cloudkitty-api'][0] }}"
|
delegate_to: "{{ groups['cloudkitty-api'][0] }}"
|
||||||
|
|
||||||
- include: bootstrap_service.yml
|
- include: bootstrap_service.yml
|
||||||
when: database_created
|
when: database.changed
|
||||||
|
@ -1,41 +1,32 @@
|
|||||||
---
|
---
|
||||||
- name: Creating congress database
|
- name: Creating congress database
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_db
|
module_name: mysql_db
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ congress_database_name }}'"
|
login_password: "{{ database_password }}"
|
||||||
|
name: "{{ congress_database_name }}"
|
||||||
register: database
|
register: database
|
||||||
changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['congress-api'][0] }}"
|
delegate_to: "{{ groups['congress-api'][0] }}"
|
||||||
|
|
||||||
- name: Reading json from variable
|
|
||||||
set_fact:
|
|
||||||
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
|
|
||||||
- name: Creating congress database user and setting permissions
|
- name: Creating congress database user and setting permissions
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_user
|
module_name: mysql_user
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ congress_database_name }}'
|
login_password: "{{ database_password }}"
|
||||||
password='{{ congress_database_password }}'
|
name: "{{ congress_database_name }}"
|
||||||
host='%'
|
password: "{{ congress_database_password }}"
|
||||||
priv='{{ congress_database_name }}.*:ALL'
|
host: "%"
|
||||||
append_privs='yes'"
|
priv: "{{ congress_database_name }}.*:ALL"
|
||||||
register: database_user_create
|
append_privs: "yes"
|
||||||
changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database_user_create.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['congress-api'][0] }}"
|
delegate_to: "{{ groups['congress-api'][0] }}"
|
||||||
|
|
||||||
- include: bootstrap_service.yml
|
- include: bootstrap_service.yml
|
||||||
when: database_created
|
when: database.changed
|
||||||
|
@ -1,41 +1,32 @@
|
|||||||
---
|
---
|
||||||
- name: Creating Glance database
|
- name: Creating Glance database
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_db
|
module_name: mysql_db
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ glance_database_name }}'"
|
login_password: "{{ database_password }}"
|
||||||
|
name: "{{ glance_database_name }}"
|
||||||
register: database
|
register: database
|
||||||
changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['glance-api'][0] }}"
|
delegate_to: "{{ groups['glance-api'][0] }}"
|
||||||
|
|
||||||
- name: Reading json from variable
|
|
||||||
set_fact:
|
|
||||||
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
|
|
||||||
- name: Creating Glance database user and setting permissions
|
- name: Creating Glance database user and setting permissions
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_user
|
module_name: mysql_user
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ glance_database_name }}'
|
login_password: "{{ database_password }}"
|
||||||
password='{{ glance_database_password }}'
|
name: "{{ glance_database_name }}"
|
||||||
host='%'
|
password: "{{ glance_database_password }}"
|
||||||
priv='{{ glance_database_name }}.*:ALL'
|
host: "%"
|
||||||
append_privs='yes'"
|
priv: "{{ glance_database_name }}.*:ALL"
|
||||||
register: database_user_create
|
append_privs: "yes"
|
||||||
changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database_user_create.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['glance-api'][0] }}"
|
delegate_to: "{{ groups['glance-api'][0] }}"
|
||||||
|
|
||||||
- include: bootstrap_service.yml
|
- include: bootstrap_service.yml
|
||||||
when: database_created
|
when: database.changed
|
||||||
|
@ -1,41 +1,32 @@
|
|||||||
---
|
---
|
||||||
- name: Creating gnocchi database
|
- name: Creating gnocchi database
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_db
|
module_name: mysql_db
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ gnocchi_database_name }}'"
|
login_password: "{{ database_password }}"
|
||||||
|
name: "{{ gnocchi_database_name }}"
|
||||||
register: database
|
register: database
|
||||||
changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['gnocchi-api'][0] }}"
|
delegate_to: "{{ groups['gnocchi-api'][0] }}"
|
||||||
|
|
||||||
- name: Reading json from variable
|
|
||||||
set_fact:
|
|
||||||
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
|
|
||||||
- name: Creating gnocchi database user and setting permissions
|
- name: Creating gnocchi database user and setting permissions
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_user
|
module_name: mysql_user
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ gnocchi_database_name }}'
|
login_password: "{{ database_password }}"
|
||||||
password='{{ gnocchi_database_password }}'
|
name: "{{ gnocchi_database_name }}"
|
||||||
host='%'
|
password: "{{ gnocchi_database_password }}"
|
||||||
priv='{{ gnocchi_database_name }}.*:ALL'
|
host: "%"
|
||||||
append_privs='yes'"
|
priv: "{{ gnocchi_database_name }}.*:ALL"
|
||||||
register: database_user_create
|
append_privs: "yes"
|
||||||
changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database_user_create.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['gnocchi-api'][0] }}"
|
delegate_to: "{{ groups['gnocchi-api'][0] }}"
|
||||||
|
|
||||||
- include: bootstrap_service.yml
|
- include: bootstrap_service.yml
|
||||||
when: database_created
|
when: database.changed
|
||||||
|
@ -1,38 +1,24 @@
|
|||||||
---
|
---
|
||||||
- name: Creating grafana database
|
- name: Creating grafana database
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
mysql_db:
|
||||||
-m mysql_db
|
login_host: "{{ database_address }}"
|
||||||
-a "login_host='{{ database_address }}'
|
login_port: "{{ database_port }}"
|
||||||
login_port='{{ database_port }}'
|
login_user: "{{ database_user }}"
|
||||||
login_user='{{ database_user }}'
|
login_password: "{{ database_password }}"
|
||||||
login_password='{{ database_password }}'
|
name: "{{ grafana_database_name }}"
|
||||||
name='{{ grafana_database_name }}'"
|
|
||||||
register: database
|
|
||||||
changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['grafana'][0] }}"
|
delegate_to: "{{ groups['grafana'][0] }}"
|
||||||
|
|
||||||
- name: Reading json from variable
|
|
||||||
set_fact:
|
|
||||||
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
|
|
||||||
- name: Creating grafana database user and setting permissions
|
- name: Creating grafana database user and setting permissions
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
mysql_user:
|
||||||
-m mysql_user
|
login_host: "{{ database_address }}"
|
||||||
-a "login_host='{{ database_address }}'
|
login_port: "{{ database_port }}"
|
||||||
login_port='{{ database_port }}'
|
login_user: "{{ database_user }}"
|
||||||
login_user='{{ database_user }}'
|
login_password: "{{ database_password }}"
|
||||||
login_password='{{ database_password }}'
|
name: "{{ grafana_database_name }}"
|
||||||
name='{{ grafana_database_name }}'
|
password: "{{ grafana_database_password }}"
|
||||||
password='{{ grafana_database_password }}'
|
host: "%"
|
||||||
host='%'
|
priv: "{{ grafana_database_name }}.*:ALL"
|
||||||
priv='{{ grafana_database_name }}.*:ALL'
|
append_privs: "yes"
|
||||||
append_privs='yes'"
|
|
||||||
register: database_user_create
|
|
||||||
changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database_user_create.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['grafana'][0] }}"
|
delegate_to: "{{ groups['grafana'][0] }}"
|
||||||
|
@ -1,41 +1,32 @@
|
|||||||
---
|
---
|
||||||
- name: Creating Heat database
|
- name: Creating Heat database
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_db
|
module_name: mysql_db
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ heat_database_name }}'"
|
login_password: "{{ database_password }}"
|
||||||
|
name: "{{ heat_database_name }}"
|
||||||
register: database
|
register: database
|
||||||
changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['heat-api'][0] }}"
|
delegate_to: "{{ groups['heat-api'][0] }}"
|
||||||
|
|
||||||
- name: Reading json from variable
|
|
||||||
set_fact:
|
|
||||||
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
|
|
||||||
- name: Creating Heat database user and setting permissions
|
- name: Creating Heat database user and setting permissions
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_user
|
module_name: mysql_user
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ heat_database_name }}'
|
login_password: "{{ database_password }}"
|
||||||
password='{{ heat_database_password }}'
|
name: "{{ heat_database_name }}"
|
||||||
host='%'
|
password: "{{ heat_database_password }}"
|
||||||
priv='{{ heat_database_name }}.*:ALL'
|
host: "%"
|
||||||
append_privs='yes'"
|
priv: "{{ heat_database_name }}.*:ALL"
|
||||||
register: database_user_create
|
append_privs: "yes"
|
||||||
changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database_user_create.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['heat-api'][0] }}"
|
delegate_to: "{{ groups['heat-api'][0] }}"
|
||||||
|
|
||||||
- include: bootstrap_service.yml
|
- include: bootstrap_service.yml
|
||||||
when: database_created
|
when: database.changed
|
||||||
|
@ -1,41 +1,32 @@
|
|||||||
---
|
---
|
||||||
- name: Creating Horizon database
|
- name: Creating Horizon database
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_db
|
module_name: mysql_db
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ horizon_database_name }}'"
|
login_password: "{{ database_password }}"
|
||||||
|
name: "{{ horizon_database_name }}"
|
||||||
register: database
|
register: database
|
||||||
changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['horizon'][0] }}"
|
delegate_to: "{{ groups['horizon'][0] }}"
|
||||||
|
|
||||||
- name: Reading json from variable
|
|
||||||
set_fact:
|
|
||||||
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
|
|
||||||
- name: Creating Horizon database user and setting permissions
|
- name: Creating Horizon database user and setting permissions
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_user
|
module_name: mysql_user
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ horizon_database_name }}'
|
login_password: "{{ database_password }}"
|
||||||
password='{{ horizon_database_password }}'
|
name: "{{ horizon_database_name }}"
|
||||||
host='%'
|
password: "{{ horizon_database_password }}"
|
||||||
priv='{{ horizon_database_name }}.*:ALL'
|
host: "%"
|
||||||
append_privs='yes'"
|
priv: "{{ horizon_database_name }}.*:ALL"
|
||||||
register: database_user_create
|
append_privs: "yes"
|
||||||
changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database_user_create.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['horizon'][0] }}"
|
delegate_to: "{{ groups['horizon'][0] }}"
|
||||||
|
|
||||||
- include: bootstrap_service.yml
|
- include: bootstrap_service.yml
|
||||||
when: database_created
|
when: database.changed
|
||||||
|
@ -1,44 +1,35 @@
|
|||||||
---
|
---
|
||||||
- name: Creating Ironic database
|
- name: Creating Ironic database
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_db
|
module_name: mysql_db
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ ironic_database_name }}'"
|
login_password: "{{ database_password }}"
|
||||||
|
name: "{{ ironic_database_name }}"
|
||||||
register: database
|
register: database
|
||||||
changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['ironic-api'][0] }}"
|
delegate_to: "{{ groups['ironic-api'][0] }}"
|
||||||
|
|
||||||
- name: Reading json from variable
|
|
||||||
set_fact:
|
|
||||||
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
|
|
||||||
- name: Creating Ironic database user and setting permissions
|
- name: Creating Ironic database user and setting permissions
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_user
|
module_name: mysql_user
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ ironic_database_name }}'
|
login_password: "{{ database_password }}"
|
||||||
password='{{ ironic_database_password }}'
|
name: "{{ ironic_database_name }}"
|
||||||
host='%'
|
password: "{{ ironic_database_password }}"
|
||||||
priv='{{ ironic_database_name }}.*:ALL'
|
host: "%"
|
||||||
append_privs='yes'"
|
priv: "{{ ironic_database_name }}.*:ALL"
|
||||||
register: database_user_create
|
append_privs: "yes"
|
||||||
changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database_user_create.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['ironic-api'][0] }}"
|
delegate_to: "{{ groups['ironic-api'][0] }}"
|
||||||
|
|
||||||
- include: bootstrap_service.yml
|
- include: bootstrap_service.yml
|
||||||
when: database_created
|
when: database.changed
|
||||||
|
|
||||||
- name: Running Ironic-PXE bootstrap container
|
- name: Running Ironic-PXE bootstrap container
|
||||||
kolla_docker:
|
kolla_docker:
|
||||||
|
@ -1,41 +1,32 @@
|
|||||||
---
|
---
|
||||||
- name: Creating Keystone database
|
- name: Creating keystone database
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_db
|
module_name: mysql_db
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ keystone_database_name }}'"
|
login_password: "{{ database_password }}"
|
||||||
|
name: "{{ keystone_database_name }}"
|
||||||
register: database
|
register: database
|
||||||
changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['keystone'][0] }}"
|
delegate_to: "{{ groups['keystone'][0] }}"
|
||||||
|
|
||||||
- name: Reading json from variable
|
|
||||||
set_fact:
|
|
||||||
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
|
|
||||||
- name: Creating Keystone database user and setting permissions
|
- name: Creating Keystone database user and setting permissions
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_user
|
module_name: mysql_user
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ keystone_database_name }}'
|
login_password: "{{ database_password }}"
|
||||||
password='{{ keystone_database_password }}'
|
name: "{{ keystone_database_name }}"
|
||||||
host='%'
|
password: "{{ keystone_database_password }}"
|
||||||
priv='{{ keystone_database_name }}.*:ALL'
|
host: "%"
|
||||||
append_privs='yes'"
|
priv: "{{ keystone_database_name }}.*:ALL"
|
||||||
register: database_user_create
|
append_privs: "yes"
|
||||||
changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database_user_create.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['keystone'][0] }}"
|
delegate_to: "{{ groups['keystone'][0] }}"
|
||||||
|
|
||||||
- include: bootstrap_service.yml
|
- include: bootstrap_service.yml
|
||||||
when: database_created
|
when: database.changed
|
||||||
|
@ -1,41 +1,32 @@
|
|||||||
---
|
---
|
||||||
- name: Creating Magnum database
|
- name: Creating Magnum database
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_db
|
module_name: mysql_db
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ magnum_database_name }}'"
|
login_password: "{{ database_password }}"
|
||||||
|
name: "{{ magnum_database_name }}"
|
||||||
register: database
|
register: database
|
||||||
changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['magnum-api'][0] }}"
|
delegate_to: "{{ groups['magnum-api'][0] }}"
|
||||||
|
|
||||||
- name: Reading json from variable
|
|
||||||
set_fact:
|
|
||||||
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
|
|
||||||
- name: Creating Magnum database user and setting permissions
|
- name: Creating Magnum database user and setting permissions
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_user
|
module_name: mysql_user
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ magnum_database_name }}'
|
login_password: "{{ database_password }}"
|
||||||
password='{{ magnum_database_password }}'
|
name: "{{ magnum_database_name }}"
|
||||||
host='%'
|
password: "{{ magnum_database_password }}"
|
||||||
priv='{{ magnum_database_name }}.*:ALL'
|
host: "%"
|
||||||
append_privs='yes'"
|
priv: "{{ magnum_database_name }}.*:ALL"
|
||||||
register: database_user_create
|
append_privs: "yes"
|
||||||
changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database_user_create.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['magnum-api'][0] }}"
|
delegate_to: "{{ groups['magnum-api'][0] }}"
|
||||||
|
|
||||||
- include: bootstrap_service.yml
|
- include: bootstrap_service.yml
|
||||||
when: database_created
|
when: database.changed
|
||||||
|
@ -1,41 +1,32 @@
|
|||||||
---
|
---
|
||||||
- name: Creating Manila database
|
- name: Creating Manila database
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_db
|
module_name: mysql_db
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ manila_database_name }}'"
|
login_password: "{{ database_password }}"
|
||||||
|
name: "{{ manila_database_name }}"
|
||||||
register: database
|
register: database
|
||||||
changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['manila-api'][0] }}"
|
delegate_to: "{{ groups['manila-api'][0] }}"
|
||||||
|
|
||||||
- name: Reading json from variable
|
|
||||||
set_fact:
|
|
||||||
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
|
|
||||||
- name: Creating Manila database user and setting permissions
|
- name: Creating Manila database user and setting permissions
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_user
|
module_name: mysql_user
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ manila_database_name }}'
|
login_password: "{{ database_password }}"
|
||||||
password='{{ manila_database_password }}'
|
name: "{{ manila_database_name }}"
|
||||||
host='%'
|
password: "{{ manila_database_password }}"
|
||||||
priv='{{ manila_database_name }}.*:ALL'
|
host: "%"
|
||||||
append_privs='yes'"
|
priv: "{{ manila_database_name }}.*:ALL"
|
||||||
register: database_user_create
|
append_privs: "yes"
|
||||||
changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database_user_create.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['manila-api'][0] }}"
|
delegate_to: "{{ groups['manila-api'][0] }}"
|
||||||
|
|
||||||
- include: bootstrap_service.yml
|
- include: bootstrap_service.yml
|
||||||
when: database_created
|
when: database.changed
|
||||||
|
@ -1,41 +1,32 @@
|
|||||||
---
|
---
|
||||||
- name: Creating Mistral database
|
- name: Creating Mistral database
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_db
|
module_name: mysql_db
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ mistral_database_name }}'"
|
login_password: "{{ database_password }}"
|
||||||
|
name: "{{ mistral_database_name }}"
|
||||||
register: database
|
register: database
|
||||||
changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['mistral-api'][0] }}"
|
delegate_to: "{{ groups['mistral-api'][0] }}"
|
||||||
|
|
||||||
- name: Reading json from variable
|
|
||||||
set_fact:
|
|
||||||
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
|
|
||||||
- name: Creating Mistral database user and setting permissions
|
- name: Creating Mistral database user and setting permissions
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_user
|
module_name: mysql_user
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ mistral_database_name }}'
|
login_password: "{{ database_password }}"
|
||||||
password='{{ mistral_database_password }}'
|
name: "{{ mistral_database_name }}"
|
||||||
host='%'
|
password: "{{ mistral_database_password }}"
|
||||||
priv='{{ mistral_database_name }}.*:ALL'
|
host: "%"
|
||||||
append_privs='yes'"
|
priv: "{{ mistral_database_name }}.*:ALL"
|
||||||
register: database_user_create
|
append_privs: "yes"
|
||||||
changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database_user_create.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['mistral-api'][0] }}"
|
delegate_to: "{{ groups['mistral-api'][0] }}"
|
||||||
|
|
||||||
- include: bootstrap_service.yml
|
- include: bootstrap_service.yml
|
||||||
when: database_created
|
when: database.changed
|
||||||
|
@ -1,41 +1,32 @@
|
|||||||
---
|
---
|
||||||
- name: Creating Murano database
|
- name: Creating Murano database
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_db
|
module_name: mysql_db
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ murano_database_name }}'"
|
login_password: "{{ database_password }}"
|
||||||
|
name: "{{ murano_database_name }}"
|
||||||
register: database
|
register: database
|
||||||
changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['murano-api'][0] }}"
|
delegate_to: "{{ groups['murano-api'][0] }}"
|
||||||
|
|
||||||
- name: Reading json from variable
|
|
||||||
set_fact:
|
|
||||||
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
|
|
||||||
- name: Creating Murano database user and setting permissions
|
- name: Creating Murano database user and setting permissions
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_user
|
module_name: mysql_user
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ murano_database_name }}'
|
login_password: "{{ database_password }}"
|
||||||
password='{{ murano_database_password }}'
|
name: "{{ murano_database_name }}"
|
||||||
host='%'
|
password: "{{ murano_database_password }}"
|
||||||
priv='{{ murano_database_name }}.*:ALL'
|
host: "%"
|
||||||
append_privs='yes'"
|
priv: "{{ murano_database_name }}.*:ALL"
|
||||||
register: database_user_create
|
append_privs: "yes"
|
||||||
changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database_user_create.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['murano-api'][0] }}"
|
delegate_to: "{{ groups['murano-api'][0] }}"
|
||||||
|
|
||||||
- include: bootstrap_service.yml
|
- include: bootstrap_service.yml
|
||||||
when: database_created
|
when: database.changed
|
||||||
|
@ -1,41 +1,32 @@
|
|||||||
---
|
---
|
||||||
- name: Creating Neutron database
|
- name: Creating Neutron database
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_db
|
module_name: mysql_db
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ neutron_database_name }}'"
|
login_password: "{{ database_password }}"
|
||||||
|
name: "{{ neutron_database_name }}"
|
||||||
register: database
|
register: database
|
||||||
changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['neutron-server'][0] }}"
|
delegate_to: "{{ groups['neutron-server'][0] }}"
|
||||||
|
|
||||||
- name: Reading json from variable
|
|
||||||
set_fact:
|
|
||||||
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
|
|
||||||
- name: Creating Neutron database user and setting permissions
|
- name: Creating Neutron database user and setting permissions
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_user
|
module_name: mysql_user
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ neutron_database_name }}'
|
login_password: "{{ database_password }}"
|
||||||
password='{{ neutron_database_password }}'
|
name: "{{ neutron_database_name }}"
|
||||||
host='%'
|
password: "{{ neutron_database_password }}"
|
||||||
priv='{{ neutron_database_name }}.*:ALL'
|
host: "%"
|
||||||
append_privs='yes'"
|
priv: "{{ neutron_database_name }}.*:ALL"
|
||||||
register: database_user_create
|
append_privs: "yes"
|
||||||
changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database_user_create.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['neutron-server'][0] }}"
|
delegate_to: "{{ groups['neutron-server'][0] }}"
|
||||||
|
|
||||||
- include: bootstrap_service.yml
|
- include: bootstrap_service.yml
|
||||||
when: database_created
|
when: database.changed
|
||||||
|
@ -1,79 +1,41 @@
|
|||||||
---
|
---
|
||||||
- name: Creating Nova database
|
- name: Creating Nova databases
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_db
|
module_name: mysql_db
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ nova_database_name }}'"
|
login_password: "{{ database_password }}"
|
||||||
|
name: "{{ item }}"
|
||||||
register: database
|
register: database
|
||||||
changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['nova-api'][0] }}"
|
delegate_to: "{{ groups['nova-api'][0] }}"
|
||||||
|
with_items:
|
||||||
|
- "{{ nova_database_name }}"
|
||||||
|
- "{{ nova_api_database_name }}"
|
||||||
|
|
||||||
- name: Reading json from variable
|
- name: Creating Nova databases user and setting permissions
|
||||||
set_fact:
|
kolla_toolbox:
|
||||||
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
module_name: mysql_user
|
||||||
|
module_args:
|
||||||
- name: Creating Nova-api database
|
login_host: "{{ database_address }}"
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
login_port: "{{ database_port }}"
|
||||||
-m mysql_db
|
login_user: "{{ database_user }}"
|
||||||
-a "login_host='{{ database_address }}'
|
login_password: "{{ database_password }}"
|
||||||
login_port='{{ database_port }}'
|
name: "{{ item.database_name }}"
|
||||||
login_user='{{ database_user }}'
|
password: "{{ item.database_password }}"
|
||||||
login_password='{{ database_password }}'
|
host: "%"
|
||||||
name='{{ nova_api_database_name }}'"
|
priv: "{{ item.database_name }}.*:ALL"
|
||||||
register: database_api
|
append_privs: "yes"
|
||||||
changed_when: "{{ database_api.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database_api.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database_api.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
|
||||||
delegate_to: "{{ groups['nova-api'][0] }}"
|
|
||||||
|
|
||||||
- name: Reading json from variable
|
|
||||||
set_fact:
|
|
||||||
database_api_created: "{{ (database_api.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
|
|
||||||
- name: Creating Nova database user and setting permissions
|
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
|
||||||
-m mysql_user
|
|
||||||
-a "login_host='{{ database_address }}'
|
|
||||||
login_port='{{ database_port }}'
|
|
||||||
login_user='{{ database_user }}'
|
|
||||||
login_password='{{ database_password }}'
|
|
||||||
name='{{ nova_database_name }}'
|
|
||||||
password='{{ nova_database_password }}'
|
|
||||||
host='%'
|
|
||||||
priv='{{ nova_database_name }}.*:ALL'
|
|
||||||
append_privs='yes'"
|
|
||||||
register: database_user_create
|
register: database_user_create
|
||||||
changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and
|
with_items:
|
||||||
(database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
- database_name: "{{ nova_database_name }}"
|
||||||
failed_when: database_user_create.stdout.split()[2] != 'SUCCESS'
|
database_password: "{{ nova_database_password }}"
|
||||||
run_once: True
|
- database_name: "{{ nova_api_database_name }}"
|
||||||
delegate_to: "{{ groups['nova-api'][0] }}"
|
database_password: "{{ nova_api_database_password }}"
|
||||||
|
|
||||||
- name: Creating Nova-api database user and setting permissions
|
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
|
||||||
-m mysql_user
|
|
||||||
-a "login_host='{{ database_address }}'
|
|
||||||
login_port='{{ database_port }}'
|
|
||||||
login_user='{{ database_user }}'
|
|
||||||
login_password='{{ database_password }}'
|
|
||||||
name='{{ nova_api_database_name }}'
|
|
||||||
password='{{ nova_api_database_password }}'
|
|
||||||
host='%'
|
|
||||||
priv='{{ nova_api_database_name }}.*:ALL'
|
|
||||||
append_privs='yes'"
|
|
||||||
register: database_api_user_create
|
|
||||||
changed_when: "{{ database_api_user_create.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database_api_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database_api_user_create.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['nova-api'][0] }}"
|
delegate_to: "{{ groups['nova-api'][0] }}"
|
||||||
|
|
||||||
- include: bootstrap_service.yml
|
- include: bootstrap_service.yml
|
||||||
when: database_created
|
when: database.changed
|
||||||
|
@ -1,41 +1,32 @@
|
|||||||
---
|
---
|
||||||
- name: Creating Octavia database
|
- name: Creating Octavia database
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_db
|
module_name: mysql_db
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ octavia_database_name }}'"
|
login_password: "{{ database_password }}"
|
||||||
|
name: "{{ octavia_database_name }}"
|
||||||
register: database
|
register: database
|
||||||
changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['octavia-api'][0] }}"
|
delegate_to: "{{ groups['octavia-api'][0] }}"
|
||||||
|
|
||||||
- name: Reading json from variable
|
|
||||||
set_fact:
|
|
||||||
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
|
|
||||||
- name: Creating Octavia database user and setting permissions
|
- name: Creating Octavia database user and setting permissions
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_user
|
module_name: mysql_user
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ octavia_database_name }}'
|
login_password: "{{ database_password }}"
|
||||||
password='{{ octavia_database_password }}'
|
name: "{{ octavia_database_name }}"
|
||||||
host='%'
|
password: "{{ octavia_database_password }}"
|
||||||
priv='{{ octavia_database_name }}.*:ALL'
|
host: "%"
|
||||||
append_privs='yes'"
|
priv: "{{ octavia_database_name }}.*:ALL"
|
||||||
register: database_user_create
|
append_privs: "yes"
|
||||||
changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database_user_create.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['octavia-api'][0] }}"
|
delegate_to: "{{ groups['octavia-api'][0] }}"
|
||||||
|
|
||||||
- include: bootstrap_service.yml
|
- include: bootstrap_service.yml
|
||||||
when: database_created
|
when: database.changed
|
||||||
|
@ -1,41 +1,32 @@
|
|||||||
---
|
---
|
||||||
- name: Creating rally database
|
- name: Creating rally database
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_db
|
module_name: mysql_db
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ rally_database_name }}'"
|
login_password: "{{ database_password }}"
|
||||||
|
name: "{{ rally_database_name }}"
|
||||||
register: database
|
register: database
|
||||||
changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['rally'][0] }}"
|
delegate_to: "{{ groups['rally'][0] }}"
|
||||||
|
|
||||||
- name: Reading json from variable
|
|
||||||
set_fact:
|
|
||||||
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
|
|
||||||
- name: Creating rally database user and setting permissions
|
- name: Creating rally database user and setting permissions
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_user
|
module_name: mysql_user
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ rally_database_name }}'
|
login_password: "{{ database_password }}"
|
||||||
password='{{ rally_database_password }}'
|
name: "{{ rally_database_name }}"
|
||||||
host='%'
|
password: "{{ rally_database_password }}"
|
||||||
priv='{{ rally_database_name }}.*:ALL'
|
host: "%"
|
||||||
append_privs='yes'"
|
priv: "{{ rally_database_name }}.*:ALL"
|
||||||
register: database_user_create
|
append_privs: "yes"
|
||||||
changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database_user_create.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['rally'][0] }}"
|
delegate_to: "{{ groups['rally'][0] }}"
|
||||||
|
|
||||||
- include: bootstrap_service.yml
|
- include: bootstrap_service.yml
|
||||||
when: database_created
|
when: database.changed
|
||||||
|
@ -1,41 +1,32 @@
|
|||||||
---
|
---
|
||||||
- name: Creating sahara database
|
- name: Creating sahara database
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_db
|
module_name: mysql_db
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ sahara_database_name }}'"
|
login_password: "{{ database_password }}"
|
||||||
|
name: "{{ sahara_database_name }}"
|
||||||
register: database
|
register: database
|
||||||
changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['sahara-api'][0] }}"
|
delegate_to: "{{ groups['sahara-api'][0] }}"
|
||||||
|
|
||||||
- name: Reading json from variable
|
|
||||||
set_fact:
|
|
||||||
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
|
|
||||||
- name: Creating sahara database user and setting permissions
|
- name: Creating sahara database user and setting permissions
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_user
|
module_name: mysql_user
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ sahara_database_name }}'
|
login_password: "{{ database_password }}"
|
||||||
password='{{ sahara_database_password }}'
|
name: "{{ sahara_database_name }}"
|
||||||
host='%'
|
password: "{{ sahara_database_password }}"
|
||||||
priv='{{ sahara_database_name }}.*:ALL'
|
host: "%"
|
||||||
append_privs='yes'"
|
priv: "{{ sahara_database_name }}.*:ALL"
|
||||||
register: database_user_create
|
append_privs: "yes"
|
||||||
changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database_user_create.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['sahara-api'][0] }}"
|
delegate_to: "{{ groups['sahara-api'][0] }}"
|
||||||
|
|
||||||
- include: bootstrap_service.yml
|
- include: bootstrap_service.yml
|
||||||
when: database_created
|
when: database.changed
|
||||||
|
@ -1,41 +1,32 @@
|
|||||||
---
|
---
|
||||||
- name: Creating Senlin database
|
- name: Creating Senlin database
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_db
|
module_name: mysql_db
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ senlin_database_name }}'"
|
login_password: "{{ database_password }}"
|
||||||
|
name: "{{ senlin_database_name }}"
|
||||||
register: database
|
register: database
|
||||||
changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['senlin-api'][0] }}"
|
delegate_to: "{{ groups['senlin-api'][0] }}"
|
||||||
|
|
||||||
- name: Reading json from variable
|
|
||||||
set_fact:
|
|
||||||
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
|
|
||||||
- name: Creating Senlin database user and setting permissions
|
- name: Creating Senlin database user and setting permissions
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_user
|
module_name: mysql_user
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ senlin_database_name }}'
|
login_password: "{{ database_password }}"
|
||||||
password='{{ senlin_database_password }}'
|
name: "{{ senlin_database_name }}"
|
||||||
host='%'
|
password: "{{ senlin_database_password }}"
|
||||||
priv='{{ senlin_database_name }}.*:ALL'
|
host: "%"
|
||||||
append_privs='yes'"
|
priv: "{{ senlin_database_name }}.*:ALL"
|
||||||
register: database_user_create
|
append_privs: "yes"
|
||||||
changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database_user_create.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['senlin-api'][0] }}"
|
delegate_to: "{{ groups['senlin-api'][0] }}"
|
||||||
|
|
||||||
- include: bootstrap_service.yml
|
- include: bootstrap_service.yml
|
||||||
when: database_created
|
when: database.changed
|
||||||
|
@ -1,41 +1,32 @@
|
|||||||
---
|
---
|
||||||
- name: Creating Solum database
|
- name: Creating Solum database
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_db
|
module_name: mysql_db
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ solum_database_name }}'"
|
login_password: "{{ database_password }}"
|
||||||
|
name: "{{ solum_database_name }}"
|
||||||
register: database
|
register: database
|
||||||
changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['solum-api'][0] }}"
|
delegate_to: "{{ groups['solum-api'][0] }}"
|
||||||
|
|
||||||
- name: Reading json from variable
|
|
||||||
set_fact:
|
|
||||||
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
|
|
||||||
- name: Creating Solum database user and setting permissions
|
- name: Creating Solum database user and setting permissions
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_user
|
module_name: mysql_user
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ solum_database_name }}'
|
login_password: "{{ database_password }}"
|
||||||
password='{{ solum_database_password }}'
|
name: "{{ solum_database_name }}"
|
||||||
host='%'
|
password: "{{ solum_database_password }}"
|
||||||
priv='{{ solum_database_name }}.*:ALL'
|
host: "%"
|
||||||
append_privs='yes'"
|
priv: "{{ solum_database_name }}.*:ALL"
|
||||||
register: database_user_create
|
append_privs: "yes"
|
||||||
changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database_user_create.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['solum-api'][0] }}"
|
delegate_to: "{{ groups['solum-api'][0] }}"
|
||||||
|
|
||||||
- include: bootstrap_service.yml
|
- include: bootstrap_service.yml
|
||||||
when: database_created
|
when: database.changed
|
||||||
|
@ -1,41 +1,32 @@
|
|||||||
---
|
---
|
||||||
- name: Creating tacker database
|
- name: Creating tacker database
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_db
|
module_name: mysql_db
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ tacker_database_name }}'"
|
login_password: "{{ database_password }}"
|
||||||
|
name: "{{ tacker_database_name }}"
|
||||||
register: database
|
register: database
|
||||||
changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['tacker'][0] }}"
|
delegate_to: "{{ groups['tacker'][0] }}"
|
||||||
|
|
||||||
- name: Reading json from variable
|
|
||||||
set_fact:
|
|
||||||
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
|
|
||||||
- name: Creating tacker database user and setting permissions
|
- name: Creating tacker database user and setting permissions
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_user
|
module_name: mysql_user
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ tacker_database_name }}'
|
login_password: "{{ database_password }}"
|
||||||
password='{{ tacker_database_password }}'
|
name: "{{ tacker_database_name }}"
|
||||||
host='%'
|
password: "{{ tacker_database_password }}"
|
||||||
priv='{{ tacker_database_name }}.*:ALL'
|
host: "%"
|
||||||
append_privs='yes'"
|
priv: "{{ tacker_database_name }}.*:ALL"
|
||||||
register: database_user_create
|
append_privs: "yes"
|
||||||
changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database_user_create.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['tacker'][0] }}"
|
delegate_to: "{{ groups['tacker'][0] }}"
|
||||||
|
|
||||||
- include: bootstrap_service.yml
|
- include: bootstrap_service.yml
|
||||||
when: database_created
|
when: database.changed
|
||||||
|
@ -1,41 +1,32 @@
|
|||||||
---
|
---
|
||||||
- name: Creating trove database
|
- name: Creating trove database
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_db
|
module_name: mysql_db
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ trove_database_name }}'"
|
login_password: "{{ database_password }}"
|
||||||
|
name: "{{ trove_database_name }}"
|
||||||
register: database
|
register: database
|
||||||
changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['trove-api'][0] }}"
|
delegate_to: "{{ groups['trove-api'][0] }}"
|
||||||
|
|
||||||
- name: Reading json from variable
|
|
||||||
set_fact:
|
|
||||||
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
|
|
||||||
- name: Creating trove database user and setting permissions
|
- name: Creating trove database user and setting permissions
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_user
|
module_name: mysql_user
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ trove_database_name }}'
|
login_password: "{{ database_password }}"
|
||||||
password='{{ trove_database_password }}'
|
name: "{{ trove_database_name }}"
|
||||||
host='%'
|
password: "{{ trove_database_password }}"
|
||||||
priv='{{ trove_database_name }}.*:ALL'
|
host: "%"
|
||||||
append_privs='yes'"
|
priv: "{{ trove_database_name }}.*:ALL"
|
||||||
register: database_user_create
|
append_privs: "yes"
|
||||||
changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database_user_create.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['trove-api'][0] }}"
|
delegate_to: "{{ groups['trove-api'][0] }}"
|
||||||
|
|
||||||
- include: bootstrap_service.yml
|
- include: bootstrap_service.yml
|
||||||
when: database_created
|
when: database.changed
|
||||||
|
@ -1,41 +1,32 @@
|
|||||||
---
|
---
|
||||||
- name: Creating Watcher database
|
- name: Creating Watcher database
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_db
|
module_name: mysql_db
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ watcher_database_name }}'"
|
login_password: "{{ database_password }}"
|
||||||
|
name: "{{ wather_database_name }}"
|
||||||
register: database
|
register: database
|
||||||
changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['watcher-api'][0] }}"
|
delegate_to: "{{ groups['watcher-api'][0] }}"
|
||||||
|
|
||||||
- name: Reading json from variable
|
|
||||||
set_fact:
|
|
||||||
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
|
|
||||||
- name: Creating Watcher database user and setting permissions
|
- name: Creating Watcher database user and setting permissions
|
||||||
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
kolla_toolbox:
|
||||||
-m mysql_user
|
module_name: mysql_user
|
||||||
-a "login_host='{{ database_address }}'
|
module_args:
|
||||||
login_port='{{ database_port }}'
|
login_host: "{{ database_address }}"
|
||||||
login_user='{{ database_user }}'
|
login_port: "{{ database_port }}"
|
||||||
login_password='{{ database_password }}'
|
login_user: "{{ database_user }}"
|
||||||
name='{{ watcher_database_name }}'
|
login_password: "{{ database_password }}"
|
||||||
password='{{ watcher_database_password }}'
|
name: "{{ wather_database_name }}"
|
||||||
host='%'
|
password: "{{ wather_database_password }}"
|
||||||
priv='{{ watcher_database_name }}.*:ALL'
|
host: "%"
|
||||||
append_privs='yes'"
|
priv: "{{ wather_database_name }}.*:ALL"
|
||||||
register: database_user_create
|
append_privs: "yes"
|
||||||
changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and
|
|
||||||
(database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
||||||
failed_when: database_user_create.stdout.split()[2] != 'SUCCESS'
|
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups['watcher-api'][0] }}"
|
delegate_to: "{{ groups['watcher-api'][0] }}"
|
||||||
|
|
||||||
- include: bootstrap_service.yml
|
- include: bootstrap_service.yml
|
||||||
when: database_created
|
when: database.changed
|
||||||
|
Loading…
Reference in New Issue
Block a user