From 42e77eaf537f1da87568fb44c246175d8cb2d803 Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Tue, 10 May 2016 22:19:42 -0500 Subject: [PATCH] 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 --- ...oved-db-create-tasks-8ae301041fe46cfb.yaml | 5 ++++ tasks/horizon_db_setup.yml | 26 ------------------- tests/test-install-infra.yml | 25 ++++++++++++++++++ tests/test-vars.yml | 3 +++ 4 files changed, 33 insertions(+), 26 deletions(-) create mode 100644 releasenotes/notes/removed-db-create-tasks-8ae301041fe46cfb.yaml diff --git a/releasenotes/notes/removed-db-create-tasks-8ae301041fe46cfb.yaml b/releasenotes/notes/removed-db-create-tasks-8ae301041fe46cfb.yaml new file mode 100644 index 00000000..98d5a849 --- /dev/null +++ b/releasenotes/notes/removed-db-create-tasks-8ae301041fe46cfb.yaml @@ -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. diff --git a/tasks/horizon_db_setup.yml b/tasks/horizon_db_setup.yml index b647cd70..bac738fa 100644 --- a/tasks/horizon_db_setup.yml +++ b/tasks/horizon_db_setup.yml @@ -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 diff --git a/tests/test-install-infra.yml b/tests/test-install-infra.yml index 86e8625e..28f28b56 100644 --- a/tests/test-install-infra.yml +++ b/tests/test-install-infra.yml @@ -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 diff --git a/tests/test-vars.yml b/tests/test-vars.yml index 81a093cc..b6423187 100644 --- a/tests/test-vars.yml +++ b/tests/test-vars.yml @@ -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