Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop unsupported python version #580

Merged
merged 10 commits into from
Jul 19, 2024
Merged
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
with:
path: 'postgresql'

- name: Set up Python 3.
- name: Set up Python.
uses: actions/setup-python@v5
with:
python-version: '3.x'
Expand All @@ -50,20 +50,21 @@ jobs:
- distro: debian12
- distro: ubuntu2004
- distro: ubuntu2204
- distro: ubuntu2404

steps:
- name: Check out the codebase.
uses: actions/checkout@v4
with:
path: 'postgresql'

- name: Set up Python 3.
- name: Set up Python.
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install test dependencies.
run: pip3 install ansible molecule molecule-plugins[docker] docker
run: pip3 install "ansible>9,<10" molecule molecule-plugins[docker] docker

- name: Run Molecule tests.
run: molecule -v test
Expand Down
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,19 @@ An example how to include this role as a task:

#### Compatibility matrix

| Distribution / PostgreSQL | 11 | 12 | 13 | 14 | 15 | 16 |
| ------------------------- | :--------: | :----------------: | :----------------: | :----------------: | :----------------: | :-------------: |
| Distribution / PostgreSQL | 11 | 12 | 13 | 14 | 15 | 16 |
| ------------------------- | :--------: | :----------------: | :----------------: | :----------------: | :----------------: | :----------------: |
| Debian 11.x | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Debian 12.x | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Rockylinux 8.x | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Rockylinux 8.x | :no_entry: | :warning: | :warning: | :warning: | :warning: | :warning: |
| Rockylinux 9.x | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Ubuntu 20.04.x | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Ubuntu 22.04.x | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |


- :white_check_mark: - tested, works fine
- :warning: - not for production use
- :grey_question: - will work in the future (help out if you can)
- :interrobang: - maybe works, not tested
- :no_entry: - has reached End of Life (EOL)
- :white_check_mark: - works fine
- :warning: - has known issues
- :no_entry: - is unsupported and/or EOL


#### Variables
Expand Down
4 changes: 1 addition & 3 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -830,8 +830,6 @@ postgresql_yum_repository_gpgkey: "{{ postgresql_pgdg_repository_url }}/keys/PGD
postgresql_dnf_repository_baseurl: "{{ postgresql_yum_repository_url }}/{{ postgresql_version }}/fedora/fedora-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}"
postgresql_dnf_repository_gpgkey: "{{ postgresql_yum_repository_gpgkey }}"

postgresql_apt_py3_dependencies: ["python3-psycopg2", "locales"]
postgresql_apt_py2_dependencies: ["python-psycopg2", "python-pycurl", "locales"]
postgresql_apt_dependencies: "{{ postgresql_apt_py3_dependencies if 'python3' in ansible_python_interpreter|default('') else postgresql_apt_py2_dependencies }}"
postgresql_apt_dependencies: ["python3-psycopg2", "locales"]

postgresql_hide_passwords: false
58 changes: 29 additions & 29 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# file: postgresql/meta/main.yml

galaxy_info:
Expand All @@ -6,42 +7,41 @@ galaxy_info:
namespace: anxs
role_name: postgresql
description: "Install and configure PostgreSQL, dependencies, extensions, databases and users."
min_ansible_version: 2.4.0
min_ansible_version: 2.12.0
license: MIT

platforms:
- name: Debian
versions:
- stretch
- buster
- name: Debian
versions:
- bullseye
- bookworm

- name: EL
versions:
- 7
- 8
- name: EL
versions:
- "8"
- "9"

- name: Ubuntu
versions:
- bionic
- focal
- xenial
- jammy
- name: Ubuntu
versions:
- focal
- jammy
- noble

- name: Fedora
versions:
- 37
- name: Fedora
versions:
- "40"

galaxy_tags:
- postgresql
- postgres
- database
- database:sql
- sql
- postgis
- debian
- centos
- redhat
- fedora
- ubuntu
- postgresql
- postgres
- database
- database:sql
- sql
- postgis
- debian
- rockylinux
- redhat
- fedora
- ubuntu

dependencies: []
27 changes: 8 additions & 19 deletions molecule/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,12 @@ The default tested versions are postgresql 12, 13, 14, 15 and 16 on Debian 11. L

The default distribution is ubuntu2204. You can override th with setting the environment variable MOLECULE_DISTRO to one of:

* centos7
* centos8
* fedora37
* debian9
* debian10
* fedora40
* debian11
* ubuntu1604
* ubuntu1804
* debian12
* ubuntu2004
* ubuntu2204
* ubuntu2404

Manual execution of the molecule tests with the distro of your liking. Examples:

Expand All @@ -37,7 +33,7 @@ Prior to the testing, molecule runs the prepare.yml playbook to:
* Create a user called `ansible`, with the default group membership of either `wheel` (CentOS, Fedora), or `sudo` (Debian, ubuntu)
* Install a couple of packages that Jeff Geerling did not install in his container images, that are needed in order to test the role properly

The main file ./molecule/default/molecule.yml sets up versions to test from 10 to 13.
The main file ./molecule/default/molecule.yml sets up versions to test from 12 to 16.

## Tests

Expand All @@ -48,26 +44,19 @@ The playbooks read variables from two files. One common vars file, and one with

```bash
$ ls -1 tests/ | grep vars
vars.CentOS.7.yml
vars.CentOS.8.yml
vars.Debian.10.yml
vars.Debian.11.yml
vars.Debian.9.yml
vars.Debian.yml
vars.Fedora.37.yml
vars.Ubuntu.16.yml
vars.Ubuntu.18.yml
vars.Debian.12.yml
vars.Fedora.40.yml
vars.Ubuntu.20.yml
vars.Ubuntu.22.yml
vars.Ubuntu.24.yml
vars.yml
```

The main difference, currently, is which python version to use.

## Local installation of molecule

```bash
pip install molecule molecule-docker
pip install molecule molecule-plugins[docker]
```

## Examples
Expand Down
Loading