Skip to content

Commit cb081ea

Browse files
authored
Merge pull request #603 from pulse-mind/decrease-ansible-deprecation-5-0-0
Fix deprecated method about ansible 12 (5.0.0), Fix CI, Remove Ubuntu 20.04 and postgresql 12
2 parents b38e897 + db88b64 commit cb081ea

26 files changed

+475
-240
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ name: CI
88
push:
99
branches:
1010
- development
11+
- decrease-ansible-deprecation-5-0-0
1112
schedule:
1213
- cron: "0 4 * * 4"
1314

@@ -48,7 +49,6 @@ jobs:
4849
# - distro: rockylinux9
4950
- distro: debian11
5051
- distro: debian12
51-
- distro: ubuntu2004
5252
- distro: ubuntu2204
5353
- distro: ubuntu2404
5454

@@ -61,10 +61,21 @@ jobs:
6161
- name: Set up Python.
6262
uses: actions/setup-python@v5
6363
with:
64-
python-version: '3.x'
64+
python-version: '3.12'
6565

66-
- name: Install test dependencies.
67-
run: pip3 install "ansible>10,<12" molecule molecule-plugins[docker] docker
66+
- name: Upgrade pip & install deps
67+
run: |
68+
python -m pip install --upgrade pip wheel setuptools
69+
# Meta-package Ansible 10/11 (include ansible-core ≥2.20)
70+
pip install "ansible>10,<12"
71+
# Testing tools
72+
pip install "molecule" "molecule-plugins[docker]" docker ansible-compat
73+
74+
- name: Show versions
75+
run: |
76+
python -V
77+
ansible --version
78+
molecule --version
6879
6980
- name: Run Molecule tests.
7081
run: molecule -v test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ Icon
99
test
1010
*.retry
1111
ANXS-postgresql.code-workspace
12+
tests/roles

README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,14 @@ An example how to include this role as a task:
5454

5555
#### Compatibility matrix
5656

57-
| Distribution / PostgreSQL | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
58-
| ------------------------- | :--------: | :----------------: | :----------------: | :----------------: | :----------------: | :----------------: | :----------------: |
59-
| Debian 11.x | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
60-
| Debian 12.x | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
61-
| Rockylinux 8.x | :no_entry: | :warning: | :warning: | :warning: | :warning: | :warning: | :warning: |
62-
| Rockylinux 9.x | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :warning: |
63-
| Ubuntu 20.04.x | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
64-
| Ubuntu 22.04.x | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
65-
| Ubuntu 24.04.x | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
57+
| Distribution / PostgreSQL | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
58+
| ------------------------- | :--------: | :--------: | :----------------: | :----------------: | :----------------: | :----------------: | :----------------: |
59+
| Debian 11.x | :no_entry: | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
60+
| Debian 12.x | :no_entry: | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
61+
| Rockylinux 8.x | :no_entry: | :no_entry: | :warning: | :warning: | :warning: | :warning: | :warning: |
62+
| Rockylinux 9.x | :no_entry: | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :warning: |
63+
| Ubuntu 22.04.x | :no_entry: | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
64+
| Ubuntu 24.04.x | :no_entry: | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
6665

6766

6867
- :white_check_mark: - works fine

defaults/main.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -838,8 +838,22 @@ postgresql_install_repository: true
838838
# APT settings
839839
postgresql_apt_key_id: "ACCC4CF8"
840840
postgresql_apt_key_url: "https://www.postgresql.org/media/keys/ACCC4CF8.asc"
841-
postgresql_apt_repository: "deb http://apt.postgresql.org/pub/repos/apt/ {{ ansible_distribution_release }}-pgdg main {{ postgresql_version }}"
841+
# postgresql_apt_keyring: "/usr/share/postgresql-common/pgdg/apt.postgresql.org.gpg"
842+
843+
# repsoitory base
844+
postgresql_apt_repo_base: "https://apt.postgresql.org/pub/repos/apt"
845+
postgresql_apt_repo_components: "main"
846+
847+
# (codename + -pgdg)
848+
postgresql_apt_suite: "{{ ansible_facts['distribution_release'] | default('') }}-pgdg"
849+
850+
# Ligne de dépôt finale (utilise les variables ci-dessus)
851+
postgresql_apt_repository: >-
852+
deb [signed-by={{ postgresql_apt_keyring }}]
853+
{{ postgresql_apt_repo_base }} {{ postgresql_apt_suite }} {{ postgresql_apt_repo_components }}
854+
842855
# Pin-Priority of PGDG repository
856+
postgresql_apt_pin_enabled: true
843857
postgresql_apt_pin_priority: 500
844858

845859
# YUM repository locations

handlers/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@
55
name: "{{ postgresql_service_name }}"
66
state: restarted
77
enabled: yes
8+
9+
- name: Reload systemd daemon
10+
ansible.builtin.command: systemctl daemon-reload
11+
become: true

molecule/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ The default distribution is ubuntu2204. You can override th with setting the env
1414
* fedora40
1515
* debian11
1616
* debian12
17-
* ubuntu2004
1817
* ubuntu2204
1918
* ubuntu2404
2019

@@ -47,7 +46,6 @@ $ ls -1 tests/ | grep vars
4746
vars.Debian.11.yml
4847
vars.Debian.12.yml
4948
vars.Fedora.40.yml
50-
vars.Ubuntu.20.yml
5149
vars.Ubuntu.22.yml
5250
vars.Ubuntu.24.yml
5351
vars.yml

molecule/default/collections.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
collections:
3+
- name: community.postgresql
4+
# pin if you want:
5+
# version: ">=3.8.0,<5.0.0"
6+
- name: community.general

molecule/default/molecule.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@ lint: |
88
# yamllint .
99
# ansible-lint
1010
platforms:
11-
- name: postgresql-12
12-
image: "geerlingguy/docker-${MOLECULE_DISTRO:-debian11}-ansible:latest"
13-
volumes:
14-
- /sys/fs/cgroup:/sys/fs/cgroup:rw
15-
privileged: true
16-
pre_build_image: true
17-
cgroupns_mode: host
18-
command: ${MOLECULE_DOCKER_COMMAND:-""}
1911
- name: postgresql-13
2012
image: "geerlingguy/docker-${MOLECULE_DISTRO:-debian11}-ansible:latest"
2113
volumes:
@@ -66,8 +58,6 @@ provisioner:
6658
converge: ${MOLECULE_PLAYBOOK:-../../tests/playbook.yml}
6759
inventory:
6860
host_vars:
69-
postgresql-12:
70-
postgresql_version: 12
7161
postgresql-13:
7262
postgresql_version: 13
7363
postgresql-14:

0 commit comments

Comments
 (0)