Removed the db create tasks

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

Change-Id: Ie4b026bdc36d6b508af4f2f7b529283039ef61d0
Depends-On: If58e482034a65c0e50241448dbe298a73c1ae71b
Depends-On: I0ca5b0403562537d2ecfdba0466a87fb0b874933
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter 2016-05-10 22:19:42 -05:00 committed by Amy Marrich (spotz)
parent 7310d47a8a
commit 42e77eaf53
4 changed files with 33 additions and 26 deletions

View File

@ -0,0 +1,5 @@
---
upgrade:
- The database and user creates have been removed from the
``os_horizon`` 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: "{{ horizon_galera_address }}"
name: "{{ horizon_galera_database }}"
state: "present"
tags:
- horizon-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: "{{ horizon_galera_address }}"
name: "{{ horizon_galera_user }}"
password: "{{ horizon_container_mysql_password }}"
host: "{{ item }}"
state: "present"
priv: "{{ horizon_galera_database }}.*:ALL"
with_items:
- "localhost"
- "%"
tags:
- horizon-db-setup
- name: Perform a horizon DB sync
command: "{{ horizon_bin }}/horizon-manage.py syncdb --noinput"
become: yes

View File

@ -30,3 +30,28 @@
galera_wsrep_provider_options:
- { option: "gcache.size", value: "32M" }
galera_server_id: "{{ inventory_hostname | string_2_int }}"
post_tasks:
- name: Create DB for service
mysql_db:
login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}"
login_host: "127.0.0.1"
name: "{{ horizon_galera_database }}"
state: "present"
when: inventory_hostname == groups['service_all'][0]
- name: Grant access to the DB for the service
mysql_user:
login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}"
login_host: "127.0.0.1"
name: "{{ horizon_galera_user }}"
password: "{{ horizon_container_mysql_password }}"
host: "{{ item }}"
state: "present"
priv: "{{ horizon_galera_database }}.*:ALL"
with_items:
- "localhost"
- "%"
when: inventory_hostname == groups['service_all'][0]
vars_files:
- test-vars.yml

View File

@ -16,11 +16,14 @@
external_lb_vip_address: 10.100.100.3
galera_client_drop_config_file: false
galera_root_password: "secrete"
galera_root_user: "root"
horizon_developer_mode: true
horizon_venv_tag: "testing"
horizon_git_install_branch: master
horizon_requirements_git_install_branch: master
horizon_galera_address: 10.100.100.2
horizon_galera_database: dash
horizon_galera_user: dash
horizon_rabbitmq_password: "secrete"
horizon_rabbitmq_userid: horizon
horizon_rabbitmq_vhost: /horizon