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

Fix version lock tests #26

Merged
merged 1 commit into from
Mar 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions defaults/main/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ __postgresql_os_search:
- "default"
__postgresql_package_extra:
redhat:
- "python3-dnf-plugin-versionlock"
- "pgaudit_{{ postgresql_release }}"
- "pg_cron_{{ postgresql_release }}"
- "glibc-langpack-{{ postgresql_locale | regex_replace('_.*', '') }}"
Expand Down
2 changes: 1 addition & 1 deletion molecule/hold/converge.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- name: Deploy PostgreSQL servers

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / lint

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (hold, debian11, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (stop, debian12, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (initdb, debian11, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (hold, ubuntu2004, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (configure, debian11, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (initdb, ubuntu2204, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (hold, ubuntu2204, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (mask, rockylinux9, /usr/lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (mask, debian11, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (mask, ubuntu2204, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (mask, debian12, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (deploy, rockylinux9, /usr/lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (initdb, debian12, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (databases, debian11, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (deploy, debian12, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (hold, debian12, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (configure, ubuntu2204, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (stop, debian11, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (stop, ubuntu2004, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (deploy, ubuntu2204, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (mask, ubuntu2004, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (stop, ubuntu2204, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (hold, rockylinux9, /usr/lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (initdb, rockylinux9, /usr/lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (deploy, debian11, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (configure, debian12, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (initdb, ubuntu2004, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (databases, ubuntu2004, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (configure, ubuntu2004, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (configure, rockylinux9, /usr/lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (databases, debian12, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (deploy, ubuntu2004, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (databases, ubuntu2204, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (databases, rockylinux9, /usr/lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/converge.yml

View workflow job for this annotation

GitHub Actions / molecule (stop, rockylinux9, /usr/lib/systemd/systemd)

1:1 [document-start] missing document start "---"
hosts: all
become: true
roles:
Expand Down Expand Up @@ -70,7 +70,7 @@
_arch: "{{ _target[0].split('.')[1] }}"
_name: "{{ _target[0].split('.')[0] }}"
_version: "{{ _target[1] }}"
_package: "{{ _name }}-{{ _version }}.{{ _arch }}"
_package: "{{ _name }}={{ _version }}.{{ _arch }}"
loop_control:
label: "{{ item.item }}"
loop: "{{ _postgresql_package_query }}"
Expand Down
14 changes: 14 additions & 0 deletions molecule/hold/verify.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- name: Verify PostgreSQL deployment

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / lint

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (hold, debian11, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (stop, debian12, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (initdb, debian11, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (hold, ubuntu2004, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (initdb, ubuntu2204, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (configure, debian11, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (hold, ubuntu2204, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (mask, rockylinux9, /usr/lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (mask, debian11, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (mask, ubuntu2204, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (mask, debian12, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (deploy, rockylinux9, /usr/lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (initdb, debian12, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (databases, debian11, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (deploy, debian12, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (hold, debian12, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (configure, ubuntu2204, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (stop, debian11, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (stop, ubuntu2004, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (deploy, ubuntu2204, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (mask, ubuntu2004, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (stop, ubuntu2204, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (hold, rockylinux9, /usr/lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (initdb, rockylinux9, /usr/lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (deploy, debian11, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (configure, debian12, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (initdb, ubuntu2004, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (databases, ubuntu2004, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (configure, ubuntu2004, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (configure, rockylinux9, /usr/lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (databases, debian12, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (deploy, ubuntu2004, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (databases, ubuntu2204, /lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (databases, rockylinux9, /usr/lib/systemd/systemd)

1:1 [document-start] missing document start "---"

Check warning on line 1 in molecule/hold/verify.yml

View workflow job for this annotation

GitHub Actions / molecule (stop, rockylinux9, /usr/lib/systemd/systemd)

1:1 [document-start] missing document start "---"
hosts: all
become: true
tasks:
Expand Down Expand Up @@ -106,3 +106,17 @@
_installed: "{{ (packages[_package] | default([{'version': 'None'}]))[0].version }}"
loop: "{{ _postgresql_package_name | zip(postgresql_package_list) }}"
when: ansible_os_family == "RedHat"

- name: Verify apt package locks
ansible.builtin.command:
cmd: "apt-mark showhold | grep {{ item }}"
loop: "{{ _postgresql_package_name }}"
when: ansible_os_family == "Debian"
changed_when: false

- name: Verify yum package locks
ansible.builtin.command:
cmd: "grep {{ item }} /etc/yum/pluginconf.d/versionlock.list"
loop: "{{ _postgresql_package_name }}"
when: ansible_os_family == "RedHat"
changed_when: false
16 changes: 14 additions & 2 deletions tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,25 @@

- name: Install packages and configure package holds
block:
- name: Install PostgreSQL server packages
- name: Install PostgreSQL deb server packages
ansible.builtin.package:
name: "{{ _server + _extra }}"
name: "{{ _packages }}"
state: "{{ postgresql_package_state }}"
vars:
_server: "{{ [_postgresql_package_name] | flatten }}"
_extra: "{{ [_postgresql_package_extra] | flatten }}"
_packages: "{{ _server + _extra }}"
when: ansible_os_family == 'Debian'

- name: Install PostgreSQL yum server packages
ansible.builtin.package:
name: "{{ _packages | regex_replace('=', '-') }}"
state: "{{ postgresql_package_state }}"
vars:
_server: "{{ [_postgresql_package_name] | flatten }}"
_extra: "{{ [_postgresql_package_extra] | flatten }}"
_packages: "{{ _server + _extra }}"
when: ansible_os_family == 'RedHat'

always:
- name: Configure package holds
Expand Down