From 2e22041213d694a6ddc936af4484e06423328749 Mon Sep 17 00:00:00 2001 From: ace Date: Wed, 15 Mar 2023 14:04:55 +0300 Subject: [PATCH] add Ubuntu 22.04 support --- README.md | 2 +- tasks/main.yaml | 2 +- vars/Ubuntu-22.04.yaml | 24 ++++++++++++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 vars/Ubuntu-22.04.yaml diff --git a/README.md b/README.md index 5d2dad3..cc61d25 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Setup standalone PostgreSQL Tested with OS: - AlmaLinux 8/9 - Debian 11 - - Ubuntu 20.04 + - Ubuntu 20.04/22.04 Supported PostgreSQL versions: - 13 diff --git a/tasks/main.yaml b/tasks/main.yaml index ad11782..74a22d6 100644 --- a/tasks/main.yaml +++ b/tasks/main.yaml @@ -23,7 +23,7 @@ include_tasks: locale.yaml tags: postgresql_locale -- name: "Install PostgreSQL for {{ ansible_facts['os_family'] }}" +- name: "Install PostgreSQL for {{ ansible_facts['distribution'] }}" include_tasks: "{{ ansible_facts['os_family'] }}/main.yaml" tags: postgresql_setup diff --git a/vars/Ubuntu-22.04.yaml b/vars/Ubuntu-22.04.yaml new file mode 100644 index 0000000..f0d5f36 --- /dev/null +++ b/vars/Ubuntu-22.04.yaml @@ -0,0 +1,24 @@ +postgresql_apt_key: + - name: org.postgresql.gpg + url: "https://www.postgresql.org/media/keys/ACCC4CF8.asc" + keyring: /etc/apt/trusted.gpg.d/org.postgresql.gpg +postgresql_apt_repository: + - repo: deb http://apt.postgresql.org/pub/repos/apt {{ ansible_distribution_release }}-pgdg main + filename: postgresql + +postgresql_deps_packages: + - gnupg + - python3-psycopg2 + +postgresql_package_name: "postgresql-{{ postgresql_major_version }}" +postgresql_package: "{{ postgresql_package_name }}={{ postgresql_version }}-{{ postgresql_version_build }}" +postgresql_version_build: "1.pgdg22.04+1" +postgresql_config_dir: "/etc/postgresql" +postgresql_home_dir: "/var/lib/postgresql" +postgresql_data_dir: "{{ postgresql_home_dir }}/{{ postgresql_major_version }}/{{ postgresql_cluster_name }}" +postgresql_ssl_path: "{{ postgresql_config_dir }}/{{ postgresql_major_version }}/{{ postgresql_cluster_name }}" +postgresql_package_name_regex: "{{ postgresql_package_name }}-{{ postgresql_version }}-{{ postgresql_version_build }}" +postgresql_cluster_name: "main" +postgresql_ssl_update_ca_command: "update-ca-certificates --fresh" +postgresql_ssl_ca_trust_dir: "/usr/local/share/ca-certificates" +postgresql_unit_name: "postgresql@{{ postgresql_major_version}}-{{ postgresql_cluster_name }}"