Merge "Removed the db create tasks"

This commit is contained in:
Jenkins 2016-05-21 02:11:55 +00:00 committed by Gerrit Code Review
commit fe79b45b6d
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