Skip to content
This repository was archived by the owner on Feb 13, 2023. It is now read-only.

Commit f3956e8

Browse files
committed
Update postgresql role to latest version.
1 parent fff10c0 commit f3956e8

File tree

10 files changed

+23
-31
lines changed

10 files changed

+23
-31
lines changed

provisioning/requirements.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ roles:
6767
- name: geerlingguy.postfix
6868
version: 2.0.0
6969
- name: geerlingguy.postgresql
70-
version: 3.0.0
70+
version: 3.1.1
7171
- name: geerlingguy.redis
7272
version: 1.7.0
7373
- name: geerlingguy.repo-epel
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
skip_list:
2-
- '405'
3-
- '503'
4-
- '106'
2+
- 'yaml'
3+
- 'no-handler'
4+
- 'role-name'

provisioning/roles/geerlingguy.postgresql/.github/workflows/ci.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,11 @@ jobs:
2929
python-version: '3.x'
3030

3131
- name: Install test dependencies.
32-
run: pip3 install yamllint ansible-lint
32+
run: pip3 install yamllint
3333

3434
- name: Lint code.
3535
run: |
3636
yamllint .
37-
ansible-lint
3837
3938
molecule:
4039
name: Molecule
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
*.retry
22
*/__pycache__
33
*.pyc
4+
.cache
5+

provisioning/roles/geerlingguy.postgresql/defaults/main.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ postgresql_python_library: python-psycopg2
1010
postgresql_user: postgres
1111
postgresql_group: postgres
1212

13+
# `md5` or `scram-sha-256` (https://www.postgresql.org/docs/10/auth-methods.html)
14+
postgresql_auth_method: "{{ ansible_fips | ternary('scram-sha-256', 'md5') }}"
15+
1316
postgresql_unix_socket_directories:
1417
- /var/run/postgresql
1518

@@ -26,8 +29,8 @@ postgresql_global_config_options:
2629
postgresql_hba_entries:
2730
- {type: local, database: all, user: postgres, auth_method: peer}
2831
- {type: local, database: all, user: all, auth_method: peer}
29-
- {type: host, database: all, user: all, address: '127.0.0.1/32', auth_method: md5}
30-
- {type: host, database: all, user: all, address: '::1/128', auth_method: md5}
32+
- {type: host, database: all, user: all, address: '127.0.0.1/32', auth_method: "{{ postgresql_auth_method }}"}
33+
- {type: host, database: all, user: all, address: '::1/128', auth_method: "{{ postgresql_auth_method }}"}
3134

3235
# Debian only. Used to generate the locales used by PostgreSQL databases.
3336
postgresql_locales:

provisioning/roles/geerlingguy.postgresql/meta/main.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ galaxy_info:
1111
platforms:
1212
- name: EL
1313
versions:
14-
- 6
1514
- 7
1615
- 8
1716
- name: Fedora
1817
versions:
19-
- 29
2018
- 30
2119
- 31
2220
- 32
21+
- 33
2322
- name: Ubuntu
2423
versions:
2524
- xenial

provisioning/roles/geerlingguy.postgresql/molecule/default/converge.yml

-10
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,6 @@
2626
changed_when: false
2727
when: ansible_os_family == 'Debian'
2828

29-
- name: Set custom variables for old CentOS 6 PostgreSQL install.
30-
set_fact:
31-
postgresql_hba_entries: []
32-
postgresql_global_config_options:
33-
- option: unix_socket_directory
34-
value: '{{ postgresql_unix_socket_directories[0] }}'
35-
when:
36-
- ansible_os_family == 'RedHat'
37-
- ansible_distribution_version.split('.')[0] == '6'
38-
3929
roles:
4030
- role: geerlingguy.postgresql
4131

provisioning/roles/geerlingguy.postgresql/tasks/users.yml

+8
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,18 @@
22
- name: Ensure PostgreSQL users are present.
33
postgresql_user:
44
name: "{{ item.name }}"
5+
password: "{{ item.password | default(omit) }}"
6+
login_host: "{{ item.login_host | default('localhost') }}"
7+
login_password: "{{ item.login_password | default(omit) }}"
8+
login_user: "{{ item.login_user | default(postgresql_user) }}"
9+
login_unix_socket: "{{ item.login_unix_socket | default(postgresql_unix_socket_directories[0]) }}"
10+
port: "{{ item.port | default(omit) }}"
511
with_items: "{{ postgresql_users }}"
612
no_log: "{{ postgres_users_no_log }}"
713
become: true
814
become_user: "{{ postgresql_user }}"
915
# See: https://github.com/ansible/ansible/issues/16048#issuecomment-229012509
1016
vars:
1117
ansible_ssh_pipelining: true
18+
environment:
19+
PGOPTIONS: "{{ (postgresql_auth_method == 'scram-sha-256') | ternary('-c password_encryption=scram-sha-256', '') }}"

provisioning/roles/geerlingguy.postgresql/tasks/users_props.yml

+2
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@
2020
# See: https://github.com/ansible/ansible/issues/16048#issuecomment-229012509
2121
vars:
2222
ansible_ssh_pipelining: true
23+
environment:
24+
PGOPTIONS: "{{ (postgresql_auth_method == 'scram-sha-256') | ternary('-c password_encryption=scram-sha-256', '') }}"

provisioning/roles/geerlingguy.postgresql/vars/RedHat-6.yml

-11
This file was deleted.

0 commit comments

Comments
 (0)