diff --git a/roles/postgresql/README.md b/roles/postgresql/README.md index aa6f4032..35bdc2f7 100644 --- a/roles/postgresql/README.md +++ b/roles/postgresql/README.md @@ -14,10 +14,11 @@ 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 for Intel chips; not needed for CentOS 7 | +| `postgresql_rpm_gpg_key_pgdg_x86_64` | URL from which to download the RPM GPP key for ARM chips; not needed for CentOS 7 | +| `postgresql_use_ssl` | Whether to use SSL | ### Required variables for the PostgreSQL server @@ -71,7 +72,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 diff --git a/roles/provision/README.md b/roles/provision/README.md index 9547093f..8038fd31 100644 --- a/roles/provision/README.md +++ b/roles/provision/README.md @@ -8,7 +8,9 @@ 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 for Intel chips. +`postgresql_rpm_gpg_key_pgdg_x86_64`: the postgresql key for ARM chips. These +are not needed for CentOS 7. `server_locale`: the sets the user's language, region, etc. This is set to "en_GB.UTF-8" diff --git a/roles/provision/defaults/main.yml b/roles/provision/defaults/main.yml index d7f996c7..6a443be6 100644 --- a/roles/provision/defaults/main.yml +++ b/roles/provision/defaults/main.yml @@ -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" diff --git a/roles/provision/tasks/Rocky.yml b/roles/provision/tasks/Rocky.yml index 3075b17e..dd669f7e 100644 --- a/roles/provision/tasks/Rocky.yml +++ b/roles/provision/tasks/Rocky.yml @@ -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: | diff --git a/tests/molecule/resources/roles/inventory/group_vars/all.yml b/tests/molecule/resources/roles/inventory/group_vars/all.yml index 360b33f7..d4f4f525 100644 --- a/tests/molecule/resources/roles/inventory/group_vars/all.yml +++ b/tests/molecule/resources/roles/inventory/group_vars/all.yml @@ -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"