From f9049eab0fca27e54075978a07589c2c7aa1c781 Mon Sep 17 00:00:00 2001 From: Markus Katharina Brechtel Date: Sat, 13 Oct 2018 11:25:46 +0000 Subject: [PATCH] handle database on localhost --- tasks/install.yml | 2 +- tasks/mysql.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/install.yml b/tasks/install.yml index 66da550..bbbf0b8 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -25,7 +25,7 @@ --admin-user "{{ nextcloud_admin_user }}" --admin-pass "{{ nextcloud_admin_pass }}" --database "{{ nextcloud_database_type }}" - --database-host "{{ nextcloud_database_host }}" + --database-host "{{ nextcloud_database_host == inventory_hostname | ternary('localhost',nextcloud_database_host) }}" --database-name "{{ nextcloud_database_name }}" --database-user "{{ nextcloud_database_user }}" --database-pass "{{ nextcloud_database_pass }}" diff --git a/tasks/mysql.yml b/tasks/mysql.yml index a1de6bf..c43f11f 100644 --- a/tasks/mysql.yml +++ b/tasks/mysql.yml @@ -3,7 +3,7 @@ - name: mysql user mysql_user: name: "{{ nextcloud_database_user }}" - host: "{{ ssh_ip }}" + host: "{{ nextcloud_database_host == inventory_hostname | ternary('localhost',ssh_ip) }}" password: "{{ nextcloud_database_pass }}" priv: "{{nextcloud_database_name}}.*:ALL" delegate_to: "{{ nextcloud_database_host }}"