Skip to content

Commit

Permalink
Add Ubuntu 22.04, update fedora & deprecate old versions (#543)
Browse files Browse the repository at this point in the history
* Deprecated key gpg warning in Ubuntu 22.04

* Added Ubuntu 22.04 into the list of distribution

* Migrate to fedora37
---------

Co-authored-by: fravetier <fravetier@vikta.com>
Co-authored-by: Pulse-Mind <pulse.mind.com@gmail.com>
  • Loading branch information
3 people authored Jul 27, 2023
1 parent 2ac60f4 commit 8bc5ff2
Show file tree
Hide file tree
Showing 18 changed files with 37 additions and 2,597 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ jobs:
- distro: centos8
- distro: debian9
- distro: debian10
- distro: fedora33
- distro: fedora37
- distro: ubuntu1604
- distro: ubuntu1804
- distro: ubuntu2004
- distro: ubuntu2204

steps:
- name: Check out the codebase.
Expand Down
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,17 @@ An example how to include this role as a task:

#### Compatibility matrix

| Distribution / PostgreSQL | 9.6 | 10 | 11 | 12 | 13 |
| ------------------------- |:---:|:--:|:--:|:--:|:--:|
| CentOS 7.x | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| CentOS 8.x | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Debian 9.x | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Debian 10.x | :grey_question: | :grey_question: | :grey_question: | :grey_question: | :grey_question: |
| Ubuntu 16.04.x | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Ubuntu 18.04.x | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Ubuntu 20.04.x | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Fedora 33 | :grey_question: | :grey_question: | :grey_question: | :grey_question: | :grey_question: |
| Distribution / PostgreSQL | 10 | 11 | 12 | 13 |
| ------------------------- |:--:|:--:|:--:|:--:|
| CentOS 7.x | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| CentOS 8.x | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Debian 9.x | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Debian 10.x | :grey_question: | :grey_question: | :grey_question: | :grey_question: |
| Ubuntu 16.04.x | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Ubuntu 18.04.x | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Ubuntu 20.04.x | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Ubuntu 22.04.x | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Fedora 37 | :grey_question: | :grey_question: | :grey_question: | :grey_question: |

- :white_check_mark: - tested, works fine
- :warning: - Not for production use
Expand Down
2 changes: 0 additions & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ postgresql_ext_install_postgis: no

# PostGIS
postgresql_postgis_release_compatibility:
9.5: "3.0"
9.6: "3.1"
10: "3.1"
12: "3.1"
13: "3.1"
Expand Down
3 changes: 2 additions & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ galaxy_info:
- bionic
- focal
- xenial
- jammy

- name: Fedora
versions:
- 33
- 37

galaxy_tags:
- postgresql
Expand Down
24 changes: 13 additions & 11 deletions molecule/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,26 @@ This directory is the home of the test playbooks:

# Molecule

The default tested version is postgresql 9.6, 10, 11, 12, and 13 on Ubuntu 20.04. Linting is disabled for the tests.
The default tested version is postgresql 10, 11, 12, and 13 on Ubuntu 20.04. Linting is disabled for the tests.

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

* centos7
* centos8
* fedora33
* fedora37
* debian9
* debian10
* ubuntu1604
* ubuntu1804
* ubuntu2004
* ubuntu2204

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

```
MOLECULE_DISTRO=centos8 molecule converge
MOLECULE_DISTRO=debian10 molecule converge
MOLECULE_DISTRO=ubuntu2004 molecule converge
MOLECULE_DISTRO=ubuntu2204 molecule converge
```

The images we use are extended with systemd by Jeff Geerling. See https://hub.docker.com/u/geerlingguy/
Expand All @@ -35,7 +36,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 9.6 to 13.
The main file ./molecule/default/molecule.yml sets up versions to test from 10 to 13.

# Tests

Expand All @@ -52,10 +53,11 @@ vars.CentOS.8.yml
vars.Debian.10.yml
vars.Debian.9.yml
vars.Debian.yml
vars.Fedora.33.yml
vars.Fedora.37.yml
vars.Ubuntu.16.yml
vars.Ubuntu.18.yml
vars.Ubuntu.20.yml
vars.Ubuntu.22.yml
```

The main difference, currently, is which python version to use.
Expand All @@ -71,7 +73,7 @@ pip install molecule molecule-docker
To run molecule tests locally, you can run the following commands:

```
#--- to just create the default containers (ubuntu2004), and run prepare.yml
#--- to just create the default containers (ubuntu2204), and run prepare.yml
molecule create
#--- to run the tests and keep the containers
Expand All @@ -84,10 +86,10 @@ molecule test
molecule destroy
#--- with specific distro release
MOLECULE_DISTRO=ubuntu2004 molecule create
MOLECULE_DISTRO=ubuntu2004 molecule converge
MOLECULE_DISTRO=ubuntu2004 molecule test
MOLECULE_DISTRO=ubuntu2004 molecule destroy
MOLECULE_DISTRO=ubuntu2204 molecule create
MOLECULE_DISTRO=ubuntu2204 molecule converge
MOLECULE_DISTRO=ubuntu2204 molecule test
MOLECULE_DISTRO=ubuntu2204 molecule destroy
```

# References
Expand Down
9 changes: 0 additions & 9 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ lint: |
# yamllint .
# ansible-lint
platforms:
- name: postgresql-9_6
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2004}-ansible:latest"
command: ""
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
privileged: true
pre_build_image: true
- name: postgresql-10
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2004}-ansible:latest"
command: ""
Expand Down Expand Up @@ -50,8 +43,6 @@ provisioner:
converge: ${MOLECULE_PLAYBOOK:-../../tests/playbook.yml}
inventory:
host_vars:
postgresql-9_6:
postgresql_version: 9.6
postgresql-10:
postgresql_version: 10
postgresql-11:
Expand Down
1 change: 1 addition & 0 deletions tasks/install_apt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
id: "{{ postgresql_apt_key_id }}"
url: "{{ postgresql_apt_key_url }}"
state: present
keyring: /etc/apt/trusted.gpg.d/postgresql.gpg
when: postgresql_apt_key_url and postgresql_apt_key_id and postgresql_install_repository

- name: PostgreSQL | Add PostgreSQL repository | apt
Expand Down
2 changes: 1 addition & 1 deletion tasks/install_fedora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- block:
- name: PostgrSQL | Install all the required dependencies | dnf
dnf:
name: "ca-certificates, python*-pycurl, glibc-common, python*-libselinux, python*-psycopg2, glibc-locale-source"
name: "acl, ca-certificates, python*-pycurl, glibc-common, python*-libselinux, python*-psycopg2, glibc-locale-source"
state: present

#--- The package manager installed psycopg2 release 2.8.8 on Fedora 33 is not compatible with postgres < 10
Expand Down
Loading

0 comments on commit 8bc5ff2

Please sign in to comment.