From 1842b7d65e18d4ac56620fb2d58200dd9875ee1c Mon Sep 17 00:00:00 2001 From: Stefan Jakobs Date: Wed, 4 Dec 2019 09:37:03 +0100 Subject: [PATCH 1/2] add postgresql_unix_socket_directories_mode option to change the mode to the unix socket directories (which causes idempotence problemes on RedHat-7) --- defaults/main.yml | 2 ++ tasks/configure.yml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index fa6a87f..0783996 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -13,6 +13,8 @@ postgresql_group: postgres postgresql_unix_socket_directories: - /var/run/postgresql +postgresql_unix_socket_directories_mode: '02755' + postgresql_service_state: started postgresql_service_enabled: true diff --git a/tasks/configure.yml b/tasks/configure.yml index 28504a5..bcbc0fb 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -24,5 +24,5 @@ state: directory owner: "{{ postgresql_user }}" group: "{{ postgresql_group }}" - mode: 02775 + mode: "{{ postgresql_unix_socket_directories_mode }}" with_items: "{{ postgresql_unix_socket_directories }}" From 4569217a8437b76d856625a8af5084e947aa3684 Mon Sep 17 00:00:00 2001 From: Stefan Jakobs Date: Wed, 4 Dec 2019 10:27:59 +0100 Subject: [PATCH 2/2] allow vars files to ship a default unix socket dir mode --- defaults/main.yml | 2 +- tasks/configure.yml | 4 +++- vars/Fedora-31.yml | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 0783996..6764563 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -13,7 +13,7 @@ postgresql_group: postgres postgresql_unix_socket_directories: - /var/run/postgresql -postgresql_unix_socket_directories_mode: '02755' +# postgresql_unix_socket_directories_mode: '02775' postgresql_service_state: started postgresql_service_enabled: true diff --git a/tasks/configure.yml b/tasks/configure.yml index bcbc0fb..993a3af 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -24,5 +24,7 @@ state: directory owner: "{{ postgresql_user }}" group: "{{ postgresql_group }}" - mode: "{{ postgresql_unix_socket_directories_mode }}" + mode: "{{ postgresql_unix_socket_directories_mode + |default(__postgresql_unix_socket_directories_mode + |default('02775')) }}" with_items: "{{ postgresql_unix_socket_directories }}" diff --git a/vars/Fedora-31.yml b/vars/Fedora-31.yml index 1638a6a..27a023e 100644 --- a/vars/Fedora-31.yml +++ b/vars/Fedora-31.yml @@ -9,5 +9,6 @@ __postgresql_packages: - postgresql-server - postgresql-contrib - postgresql-libs +__postgresql_unix_socket_directories_mode: '0755' # Fedora 31 containers only have python3 by default postgresql_python_library: python3-psycopg2