From d4ae89792dca33bc070e6ea1376b66b2c4ab271b Mon Sep 17 00:00:00 2001 From: Jonathan Rosser Date: Thu, 18 Jul 2019 11:40:59 +0100 Subject: [PATCH] Add _oslodb_login_host to db_setup tasks. The ansible mysql modules defaults to localhost, which means that the db_setup tasks fail if the mysql processes are bound to the mgmt interface. This change adds an extra variable _oslodb_login_host for the db_setup tasks which is defaulted to _oslodb_setup_host if a specific value is not defined. Change-Id: I531109213953f78263be68968f8e9d2dc2fd382a --- sync/tasks/db_setup.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sync/tasks/db_setup.yml b/sync/tasks/db_setup.yml index 7a0120d4..aca206e4 100644 --- a/sync/tasks/db_setup.yml +++ b/sync/tasks/db_setup.yml @@ -22,12 +22,16 @@ - name: Setup Database Service (MariaDB) delegate_to: "{{ _oslodb_setup_host }}" + vars: + ansible_python_interpreter: "{{ _oslodb_ansible_python_interpreter }}" tags: - common-mariadb block: - name: Create database for service mysql_db: name: "{{ item.name }}" + login_host: "{{ _oslodb_setup_endpoint | default(omit) }}" + login_port: "{{ _oslodb_setup_port | default(omit) }}" loop: "{{ _oslodb_databases }}" no_log: true @@ -38,5 +42,7 @@ host: "{{ item.1.host | default('%') }}" priv: "{{ item.0.name }}.*:{{ item.1.priv | default('ALL') }}" append_privs: yes + login_host: "{{ _oslodb_setup_endpoint | default(omit) }}" + login_port: "{{ _oslodb_setup_port | default(omit) }}" loop: "{{ _oslodb_databases | subelements('users') }}" no_log: true