Removed the db create tasks

The db create tasks have been removed from the role and have been
relocated into the playbooks.

Change-Id: I58534768417f93feeef889863068818ed9e41d52
Depends-On: If58e482034a65c0e50241448dbe298a73c1ae71b
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
Matt Thompson 2016-05-13 13:41:18 +01:00
parent c94e35654d
commit 257b7ad1c9
4 changed files with 34 additions and 26 deletions

View File

@ -0,0 +1,5 @@
---
upgrade:
- The database create and user creates have been removed
from the ``os_cinder`` role. These tasks have been relocated
to the playbooks.

View File

@ -13,32 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Create DB for service
mysql_db:
login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}"
login_host: "{{ cinder_galera_address }}"
name: "{{ cinder_galera_database }}"
state: "present"
tags:
- cinder-db-setup
- name: Grant access to the DB for the service
mysql_user:
login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}"
login_host: "{{ cinder_galera_address }}"
name: "{{ cinder_galera_user }}"
password: "{{ cinder_container_mysql_password }}"
host: "{{ item }}"
state: "present"
priv: "{{ cinder_galera_database }}.*:ALL"
with_items:
- "localhost"
- "%"
tags:
- cinder-db-setup
- name: Perform a cinder DB sync
command: "{{ cinder_bin }}/cinder-manage db sync"
become: yes

View File

@ -35,6 +35,32 @@
state: "present"
delegate_to: "10.100.100.2"
when: inventory_hostname == groups['cinder_all'][0]
- name: Create DB for service
mysql_db:
login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}"
login_host: "{{ cinder_galera_address }}"
name: "{{ cinder_galera_database }}"
state: "present"
when: inventory_hostname == groups['cinder_all'][0]
tags:
- mysql-db-setup
- name: Grant access to the DB for the service
mysql_user:
login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}"
login_host: "{{ cinder_galera_address }}"
name: "{{ cinder_galera_user }}"
password: "{{ cinder_container_mysql_password }}"
host: "{{ item }}"
state: "present"
priv: "{{ cinder_galera_database }}.*:ALL"
when: inventory_hostname == groups['cinder_all'][0]
with_items:
- "localhost"
- "%"
tags:
- mysql-db-setup
roles:
- role: "{{ rolename | basename }}"
vars_files:

View File

@ -12,6 +12,8 @@ cinder_profiler_hmac_key: "secrete"
cinder_rabbitmq_password: "secrete"
cinder_rabbitmq_userid: cinder
cinder_rabbitmq_vhost: /cinder
cinder_galera_user: cinder
cinder_galera_database: cinder
cinder_requirements_git_install_branch: master
cinder_service_password: "secrete"
cinder_venv_bin: "/openstack/venvs/cinder-{{ cinder_venv_tag }}/bin"
@ -19,6 +21,7 @@ cinder_venv_tag: "testing"
debug: true
external_lb_vip_address: 10.100.100.3
galera_client_drop_config_file: false
galera_root_user: "root"
galera_root_password: "secrete"
internal_lb_vip_address: 10.100.100.3
keystone_admin_tenant_name: admin