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

Handle both intel & ARM RPM key #34

Merged
merged 6 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
10 changes: 5 additions & 5 deletions roles/postgresql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ There are also several **required** variables you will need to set before using

### Variables required by both the server and client

| Name | Description |
| ----------------------------- | ------------------------------------------------------------------- |
| `postgresql_rpm_gpg_key_pgdg` | URL from which to download the RPM GPP key; not needed for CentOS 7 |
| `postgresql_use_ssl` | Whether to use SSL |
| Name | Description |
| ------------------------------------ | ------------------------------------------------------------------- |
| `postgresql_rpm_gpg_key_pgdg_x86_64` | URL from which to download the RPM GPP key; not needed for CentOS 7 |
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, there are two... Do we need to document both?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes please

| `postgresql_use_ssl` | Whether to use SSL |

### Required variables for the PostgreSQL server

Expand Down Expand Up @@ -71,7 +71,7 @@ To use this role with a dual-server setup (a dartase `db` and a web server `web`
- name: Import postgresql rpm key
ansible.builtin.rpm_key:
state: present
key: "{{ postgresql_rpm_gpg_key_pgdg }}"
key: "{{ postgresql_rpm_gpg_key_pgdg_x86_64 }}"

- name: Create client SSL certificate
hosts: web
Expand Down
2 changes: 1 addition & 1 deletion roles/provision/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ If you would like to run Ansible Molecule to test this role, the requirements ar

## Role Variables

`postgresql_rpm_gpg_key_pgdg`: the postgresql key. This is not needed for CentOS 7.
`postgresql_rpm_gpg_key_pgdg_x86_64`: the postgresql key. This is not needed for CentOS 7.

`server_locale`: the sets the user's language, region, etc. This is set to "en_GB.UTF-8"

Expand Down
7 changes: 6 additions & 1 deletion roles/provision/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
postgresql_rpm_gpg_key_pgdg: "https://www.postgresql.org/download/keys/RPM-GPG-KEY-PGDG" # not needed for CentOS 7
# not needed for CentOS 7
postgresql_rpm_gpg_key_pgdg_x86_64: >-
https://apt.postgresql.org/pub/repos/yum/keys/PGDG-RPM-GPG-KEY-RHEL
# not needed for CentOS 7
postgresql_rpm_gpg_key_pgdg_aarch64: >-
https://apt.postgresql.org/pub/repos/yum/keys/PGDG-RPM-GPG-KEY-AARCH64-RHEL
server_locale: "en_GB.UTF-8"
4 changes: 3 additions & 1 deletion roles/provision/tasks/Rocky.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
- name: Import postgresql rpm key
ansible.builtin.rpm_key:
state: present
key: "{{ postgresql_rpm_gpg_key_pgdg }}"
key: >-
{{ lookup('vars',
'postgresql_rpm_gpg_key_pgdg_' + ansible_architecture) }}

- name: Check if locale already set
ansible.builtin.shell: |
Expand Down
3 changes: 2 additions & 1 deletion tests/molecule/resources/roles/inventory/group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ firewalld_internal_zone_ports:
- "5432"

# mirsg.infrastructure.postgresql
postgresql_rpm_gpg_key_pgdg: "https://www.postgresql.org/download/keys/RPM-GPG-KEY-PGDG"
postgresql_rpm_gpg_key_pgdg_x86_64: >-
https://apt.postgresql.org/pub/repos/yum/keys/PGDG-RPM-GPG-KEY-RHEL
postgresql_use_ssl: false
postgresql_database:
database_name: "database"
Expand Down