diff --git a/.github/workflows/molecule.yml b/.github/workflows/molecule.yml index aa449cc78..884b18ef4 100644 --- a/.github/workflows/molecule.yml +++ b/.github/workflows/molecule.yml @@ -25,6 +25,9 @@ jobs: - distro: debian10 tag: latest namespace: geerlingguy + - distro: ubuntu2404 + tag: latest + namespace: geerlingguy - distro: ubuntu2204 tag: latest namespace: geerlingguy diff --git a/.github/workflows/schedule_pg_ubuntu2404.yml b/.github/workflows/schedule_pg_ubuntu2404.yml new file mode 100644 index 000000000..8cb33dc62 --- /dev/null +++ b/.github/workflows/schedule_pg_ubuntu2404.yml @@ -0,0 +1,32 @@ +--- +name: scheduled PostgreSQL (Ubuntu 24.04) + +on: + schedule: + - cron: "30 0 * * *" + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Set TERM environment variable + run: echo "TERM=xterm" >> $GITHUB_ENV + + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: "3.10" + + - name: Install dependencies + run: make bootstrap-dev + + - name: Run Molecule tests + run: make molecule-test + env: + PY_COLORS: "1" + ANSIBLE_FORCE_COLOR: "1" + IMAGE_DISTRO: ubuntu2404 diff --git a/README.md b/README.md index 8a4ee7a56..a321799c5 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ RedHat and Debian based distros (x86_64) ###### Supported Linux Distributions: - **Debian**: 10, 11, 12 -- **Ubuntu**: 20.04, 22.04 +- **Ubuntu**: 20.04, 22.04, 24.04 - **CentOS Stream**: 9 - **Oracle Linux**: 8, 9 - **Rocky Linux**: 8, 9 diff --git a/files/requirements.txt b/files/requirements.txt index 3b7215500..a67121a52 100644 --- a/files/requirements.txt +++ b/files/requirements.txt @@ -8,7 +8,6 @@ python-consul>=0.7.1 click>=4.1 prettytable>=0.7 python-dateutil -pysyncobj>=0.3.8 psutil>=2.0.0 ydiff>=1.2.0 pexpect==4.9.0 diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml index 68c906337..c98d42b52 100644 --- a/molecule/default/converge.yml +++ b/molecule/default/converge.yml @@ -33,6 +33,17 @@ delegate_to: localhost run_once: true # noqa run-once + # Consul package for OracleLinux, Debian 10 (EOL) missing in HashiCorp repository + # Only the installation of a binary file is supported + - name: "Set variables: 'consul_install_from_repo: false' and 'patroni_installation_method: pip'" + ansible.builtin.set_fact: + consul_install_from_repo: false # whether to install consul from repository as opposed to installing the binary directly + patroni_installation_method: "pip" # the "rpm" method is supported only for consul installed from the repository + when: + - dcs_type == "consul" + - ansible_distribution == "OracleLinux" or + (ansible_distribution == "Debian" and ansible_distribution_major_version == '10') + - name: Set variables for custom PostgreSQL data and WAL directory test ansible.builtin.set_fact: postgresql_data_dir: "/pgdata/{{ postgresql_version }}/main" @@ -41,9 +52,6 @@ - name: Set variables for TimescaleDB cluster deployment test ansible.builtin.set_fact: enable_timescale: true - when: - - not (ansible_distribution == 'Ubuntu' and ansible_distribution_version is version('20.04', '<')) - - not (ansible_distribution == 'Debian' and ansible_distribution_version is version('11', '>')) # TODO Debian 12 - name: Set variables for PostgreSQL Cluster update test ansible.builtin.set_fact: diff --git a/molecule/pg_upgrade/converge.yml b/molecule/pg_upgrade/converge.yml index 7c656d697..6f57f7295 100644 --- a/molecule/pg_upgrade/converge.yml +++ b/molecule/pg_upgrade/converge.yml @@ -22,6 +22,17 @@ delegate_to: localhost run_once: true # noqa run-once + # Consul package for OracleLinux, Debian 10 (EOL) missing in HashiCorp repository + # Only the installation of a binary file is supported + - name: "Set variables: 'consul_install_from_repo: false' and 'patroni_installation_method: pip'" + ansible.builtin.set_fact: + consul_install_from_repo: false # whether to install consul from repository as opposed to installing the binary directly + patroni_installation_method: "pip" # the "rpm" method is supported only for consul installed from the repository + when: + - dcs_type == "consul" + - ansible_distribution == "OracleLinux" or + (ansible_distribution == "Debian" and ansible_distribution_major_version == '10') + - name: Set variables for custom PostgreSQL data and WAL directory test ansible.builtin.set_fact: postgresql_data_dir: "/pgdata/{{ postgresql_version }}/main" @@ -29,10 +40,7 @@ - name: Set variables for TimescaleDB cluster deployment test ansible.builtin.set_fact: - enable_timescale: false # TODO (enable when adding PostgreSQL 16 support) - when: - - not (ansible_distribution == 'Ubuntu' and ansible_distribution_version is version('20.04', '<')) - - not (ansible_distribution == 'Debian' and ansible_distribution_version is version('11', '>')) # TODO Debian 12 + enable_timescale: true - name: Set variables for PostgreSQL upgrade test ansible.builtin.set_fact: diff --git a/roles/consul/files/consul_1.15.8_SHA256SUMS b/roles/consul/files/consul_1.15.8_SHA256SUMS deleted file mode 100644 index 734b47a95..000000000 --- a/roles/consul/files/consul_1.15.8_SHA256SUMS +++ /dev/null @@ -1,11 +0,0 @@ -53624578f2cf4826cbd6d001172870857ebd763402dff02f3b6fc90250167867 consul_1.15.8_darwin_amd64.zip -502a8788c3391a5b5f01ad64dfe1eb39c057c9ed1f26e1348168bde2204a02ea consul_1.15.8_darwin_arm64.zip -74a21f3c39eb1f3f6d5d17f5d36fdf3e9137d1d0a4cf9beeef7a017a9d1ea7ce consul_1.15.8_freebsd_386.zip -4cf47e8a89cb3dcdea5b5c66bcc829c59dca2c412bcc2d4e47951aec999a6c7e consul_1.15.8_freebsd_amd64.zip -e659ea683944674d3a7541606549dc1dae721eac8c6e8ebcfe28fe6897e4d6b1 consul_1.15.8_linux_386.zip -abe294b24db29cab2ce44601ed182f95d2e6d390191f5937136242ebcd8d4ad8 consul_1.15.8_linux_amd64.zip -796c10fa3b2e5bc74a07448a9db81fdc62c33b2761e764939df4adb9655efdd6 consul_1.15.8_linux_arm.zip -b9045049c665e096a4e10b40787a6d222c3a2b8778d8393fcf1732495d980864 consul_1.15.8_linux_arm64.zip -a30bfbb7264def46577088447d229c746dddc474313a6233189263946a496dcb consul_1.15.8_solaris_amd64.zip -c173a55fb7d7973922edd4a996a34a43dbec6c7015b75629bda19b55d677f6ec consul_1.15.8_windows_386.zip -a26ab8dbc7b2665184bd663b7c8b3f45e867ce9239a16f15ac67cdead14d7954 consul_1.15.8_windows_amd64.zip diff --git a/roles/consul/files/consul_1.19.1_SHA256SUMS b/roles/consul/files/consul_1.19.1_SHA256SUMS new file mode 100644 index 000000000..d6e1606fd --- /dev/null +++ b/roles/consul/files/consul_1.19.1_SHA256SUMS @@ -0,0 +1,11 @@ +0b3b78d11d31a66938c9a90f5a9361e8363a43688f7f25fe300e37a95373d209 consul_1.19.1_darwin_amd64.zip +f2fc99fa8fb5e193f3ceefc7594f11200fa539ddfa8800c5925c59f62facee48 consul_1.19.1_darwin_arm64.zip +e0294fdcaa198fd15b058b5500c4847ee4d0b002b2b4665b8322e0668e879f94 consul_1.19.1_freebsd_386.zip +2229d8ace4066f3cf51031dae00c4fc05d3025b98bc300def6e717134aafa9c5 consul_1.19.1_freebsd_amd64.zip +87431003ee2c0caf86d827a0dfb43fc285ed9d4864f35d505a116f4744d496ca consul_1.19.1_linux_386.zip +aa48085aaa6f4130d0f1ee98c416dcd51b1b0f980d34f5b91834fd5b3387891c consul_1.19.1_linux_amd64.zip +a4a54fd0ca6991d48d617311dfb1623d6030140a10c005ad33809dad864da239 consul_1.19.1_linux_arm.zip +9699e5a2b85b4447a81b01138c3e0ef42dbcdd9df4f04e9318af9017aae73cc4 consul_1.19.1_linux_arm64.zip +ed81780dd374a00292f864ac457e28feffb637964acc397c9cd2676ca565041b consul_1.19.1_solaris_amd64.zip +5e6cc24d3219c1c331f9b39ade2961b9948c86e254a214751b921b4027f168a5 consul_1.19.1_windows_386.zip +a33bed52d6004c956b5b9a1fa6659477a32db14a07d37425f9ed96a6b1eaeae2 consul_1.19.1_windows_amd64.zip diff --git a/roles/consul/files/consul_1.15.8_linux_amd64.zip b/roles/consul/files/consul_1.19.1_linux_amd64.zip similarity index 76% rename from roles/consul/files/consul_1.15.8_linux_amd64.zip rename to roles/consul/files/consul_1.19.1_linux_amd64.zip index 2ebe986c8..6648b4338 100644 Binary files a/roles/consul/files/consul_1.15.8_linux_amd64.zip and b/roles/consul/files/consul_1.19.1_linux_amd64.zip differ diff --git a/roles/consul/tasks/install_linux_repo.yml b/roles/consul/tasks/install_linux_repo.yml index 65539e748..3e70ae534 100644 --- a/roles/consul/tasks/install_linux_repo.yml +++ b/roles/consul/tasks/install_linux_repo.yml @@ -10,7 +10,7 @@ delay: 5 retries: 3 become: true - when: (consul_os_repo_prerequisites) + when: consul_os_repo_prerequisites | default(true) | bool tags: installation - name: Gather the package facts @@ -49,7 +49,7 @@ - name: Install repository block: - - name: Add Redhat/CentOS/Fedora/Amazon Linux repository + - name: Add hashicorp repository ansible.builtin.command: "yum-config-manager --add-repo {{ consul_repo_url }}" args: creates: /etc/yum.repos.d/hashicorp.repo @@ -67,7 +67,7 @@ state: present when: "ansible_os_family|lower == 'debian'" - - name: Add Debian/Ubuntu Linux repository + - name: Add hashicorp repository ansible.builtin.apt_repository: repo: "deb {{ consul_repo_url }} {{ ansible_distribution_release }} main" state: present @@ -79,8 +79,8 @@ - name: Install consul package ansible.builtin.package: - name: "consul{{ '=' if ansible_pkg_mgr == 'apt' else '-' }}{{ consul_version }}" - state: present + name: consul + state: latest register: package_status until: package_status is success delay: 5 diff --git a/roles/consul/vars/RedHat-8.yml b/roles/consul/vars/RedHat-8.yml deleted file mode 100644 index c1b1b475d..000000000 --- a/roles/consul/vars/RedHat-8.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -# File: RedHat-8.yml - Red Hat OS version 8.x variables for Consul - -consul_os_packages: - - python3-libselinux - - unzip -dnsmasq_package: dnsmasq diff --git a/roles/consul/vars/RedHat.yml b/roles/consul/vars/RedHat.yml index 958b435d7..17157c199 100644 --- a/roles/consul/vars/RedHat.yml +++ b/roles/consul/vars/RedHat.yml @@ -2,10 +2,7 @@ # File: RedHat.yml - Red Hat OS variables for Consul consul_os_packages: - - "{{ 'libselinux-python' if (ansible_distribution == 'Fedora' and ansible_distribution_version is version('28', '<')) or - (ansible_distribution == 'CentOS' and ansible_distribution_version is version('8', '<')) or - (ansible_distribution == 'Amazon' and ansible_distribution_version is version('3', '<')) or - (ansible_distribution == 'OracleLinux' and ansible_distribution_version is version('8', '<')) else 'python3-libselinux' }}" + - python3-libselinux - unzip consul_repo_prerequisites: diff --git a/roles/consul/vars/Rocky-8.yml b/roles/consul/vars/Rocky-8.yml deleted file mode 100644 index a15ecaf66..000000000 --- a/roles/consul/vars/Rocky-8.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -# File: Rocky-8.yml - Rocky Linux version 8.x variables for Consul - -consul_os_packages: - - python3-libselinux - - unzip diff --git a/roles/cron/tasks/main.yml b/roles/cron/tasks/main.yml index 74fd32e88..e37adc682 100644 --- a/roles/cron/tasks/main.yml +++ b/roles/cron/tasks/main.yml @@ -10,7 +10,9 @@ delay: 5 retries: 3 environment: "{{ proxy_env | default({}) }}" - when: ansible_os_family == "RedHat" + when: + - cron_jobs is defined and cron_jobs | length > 0 + - ansible_os_family == "RedHat" tags: cron - name: Make sure that the cron package is installed @@ -22,7 +24,9 @@ delay: 5 retries: 3 environment: "{{ proxy_env | default({}) }}" - when: ansible_os_family == "Debian" + when: + - cron_jobs is defined and cron_jobs | length > 0 + - ansible_os_family == "Debian" tags: cron - name: Add cron jobs diff --git a/vars/Debian.yml b/vars/Debian.yml index e10e3e115..15534b885 100644 --- a/vars/Debian.yml +++ b/vars/Debian.yml @@ -33,6 +33,7 @@ os_specific_packages: Debian-12: [python3] # python 2 is not required Ubuntu-20: [python3] # python 2 is not required Ubuntu-22: [python3] # python 2 is not required + Ubuntu-24: [python3] # python 2 is not required system_packages: - "{{ os_specific_packages[ansible_distribution ~ '-' ~ ansible_distribution_major_version] }}" - python3 @@ -70,51 +71,32 @@ etcd_package_repo: "https://github.com/etcd-io/etcd/releases/download/v{{ etcd_v vip_manager_package_repo: "https://github.com/cybertec-postgresql/vip-manager/releases/download/v{{ vip_manager_version }}/vip-manager_{{ vip_manager_version }}_Linux_x86_64.deb" -# (if with_haproxy_load_balancing: true) -haproxy_installation_method: "deb" # (default)"deb" or "src" -haproxy_install_repo: true # or 'false' -# for Debian 10 the haproxy version 1.8 (LTS) will be installed from the haproxy.debian.net repository. -# you can preload the haproxy deb packages to your APT repository (in this case specify "haproxy_install_repo: false"). -confd_package_repo: "https://github.com/kelseyhightower/confd/releases/download/v0.16.0/confd-0.16.0-linux-amd64" +installation_method: "repo" # "repo" (default) or "file" -# (optional) if haproxy_installation_method: 'src' -haproxy_major: "1.8" -haproxy_version: "1.8.25" # version to build from source -lua_src_repo: "https://www.lua.org/ftp/lua-5.3.5.tar.gz" # required for build haproxy -haproxy_src_repo: "https://www.haproxy.org/download/{{ haproxy_major }}/src/haproxy-{{ haproxy_version }}.tar.gz" -haproxy_compile_requirements: - - unzip - - gzip - - make - - gcc - - build-essential - - libc6-dev - - libpcre3-dev - - liblua5.3-dev - - libreadline-dev - - zlib1g-dev - - libsystemd-dev - - ca-certificates - - libssl-dev +# The Patroni package will be installed from the deb package by default. +# You also have the option of choosing an installation method using the pip package. +patroni_installation_method: "deb" # "deb" (default) or "pip" -# You can also use your own repository for extra packages. You need to preload all the packages and change this URLs. -installation_method: "repo" # (default)"repo" or "file" +# if patroni_installation_method: "pip" +patroni_install_version: "latest" # or a specific version (e.q., '3.3.2') -# Patroni package will be installed from the pip (by default). -# You also have the option of choosing an patroni installation method using the deb package. -patroni_installation_method: "pip" # (default)"pip" or "deb" # if patroni_installation_method: "deb" patroni_packages: - patroni + - python3-{{ dcs_type }} + +# if patroni_installation_method: "deb" (optional) +# You can preload the patroni deb package to your APT repository, or explicitly specify the path to the package in this variable: +patroni_deb_package_repo: [] +# - "https://apt.postgresql.org/pub/repos/apt/pool/main/p/patroni/patroni_3.3.0-1.pgdg22.04%2B1_all.deb" # (package for Ubuntu 22.04) -# (if patroni_installation_type: "pip") -# Packages from your repository will be used to install instead of the pip repository. +# if patroni_installation_method: "pip" (optional) +# Packages from your repository will be used to install. By default, it is installed from the public pip repository. pip_package_repo: "https://bootstrap.pypa.io/get-pip.py" # latest version pip3 for python3 (or use "pip-.tar.gz"). patroni_pip_requirements_repo: [] # - "http://my-repo.url/setuptools-41.2.0.zip" # - "http://my-repo.url/setuptools_scm-3.3.3.tar.gz" # - "http://my-repo.url/urllib3-1.24.3.tar.gz" -# - "http://my-repo.url/boto-2.49.0.tar.gz" # (interfaces to Amazon Web Services) # - "http://my-repo.url/PyYAML-5.1.2.tar.gz" # - "http://my-repo.url/chardet-3.0.4.tar.gz" # - "http://my-repo.url/idna-2.8.tar.gz" @@ -135,56 +117,83 @@ patroni_pip_requirements_repo: [] patroni_pip_package_repo: [] # - "http://my-repo.url/patroni-1.6.0.tar.gz" -# ( if patroni_installation_type: "deb" ) -# You can preload the patroni deb package to your APT repository, or explicitly specify the path to the package in this variable: -patroni_deb_package_repo: [] -# - "https://apt.postgresql.org/pub/repos/apt/pool/main/p/patroni/patroni_2.1.4-2.pgdg22.04%2B1_all.deb" # (package for Ubuntu 22.04) +# if with_haproxy_load_balancing: true +haproxy_installation_method: "deb" # "deb" (default) or "src" +haproxy_install_repo: true # or 'false' +# for Debian 10 the haproxy version 1.8 (LTS) will be installed from the haproxy.debian.net repository. +# you can preload the haproxy deb packages to your APT repository (in this case specify "haproxy_install_repo: false"). +confd_package_repo: "https://github.com/kelseyhightower/confd/releases/download/v0.16.0/confd-0.16.0-linux-amd64" + +# if haproxy_installation_method: 'src' (optional) +haproxy_major: "1.8" +haproxy_version: "1.8.31" # version to build from source +lua_src_repo: "https://www.lua.org/ftp/lua-5.3.5.tar.gz" # required for build haproxy +haproxy_src_repo: "https://www.haproxy.org/download/{{ haproxy_major }}/src/haproxy-{{ haproxy_version }}.tar.gz" +haproxy_compile_requirements: + - unzip + - gzip + - make + - gcc + - build-essential + - libc6-dev + - libpcre3-dev + - liblua5.3-dev + - libreadline-dev + - zlib1g-dev + - libsystemd-dev + - ca-certificates + - libssl-dev # ================================================================================================= # -# (optional) if installation_method: "file" +# Offline installation (if installation_method: "file") +# # You can also download the necessary packages into postgresql_cluster/files/ directory. # Packages from this directory will be used for installation. -pip_package_file: "pip-19.2.3.tar.gz" # https://pypi.org/project/pip/#files -patroni_pip_requirements_file: - - "setuptools-41.2.0.zip" # https://pypi.org/project/setuptools/#files - - "setuptools_scm-3.3.3.tar.gz" # https://pypi.org/project/setuptools-scm/#files - - "urllib3-1.24.3.tar.gz" # https://pypi.org/project/urllib3/1.24.3/#files - - "boto-2.49.0.tar.gz" # https://pypi.org/project/boto/#files # (interfaces to Amazon Web Services) - - "PyYAML-5.1.2.tar.gz" # https://pypi.org/project/PyYAML/#files - - "chardet-3.0.4.tar.gz" # https://pypi.org/project/chardet/#files # (required for "requests") - - "idna-2.8.tar.gz" # https://pypi.org/project/idna/#files # (required for "requests") - - "certifi-2019.9.11.tar.gz" # https://pypi.org/project/certifi/#files # (required for "requests") - - "requests-2.22.0.tar.gz" # https://pypi.org/project/requests/#files - - "six-1.12.0.tar.gz" # https://pypi.org/project/six/#files - - "kazoo-2.6.1.tar.gz" # https://pypi.org/project/kazoo/#files - - "dnspython-1.16.0.zip" # https://pypi.org/project/dnspython/#files # (required for "python-etcd") - - "python-etcd-0.4.5.tar.gz" # https://pypi.org/project/python-etcd/#files - - "Click-7.0.tar.gz" # https://pypi.org/project/click/#files - - "prettytable-0.7.2.tar.gz" # https://pypi.org/project/PrettyTable/#files - - "pytz-2019.2.tar.gz" # https://pypi.org/project/pytz/#files # (required for "tzlocal") - - "tzlocal-2.0.0.tar.gz" # https://pypi.org/project/tzlocal/#files - - "wheel-0.33.6.tar.gz" # https://pypi.org/project/wheel/#files - - "python-dateutil-2.8.0.tar.gz" # https://pypi.org/project/python-dateutil/#files - - "psutil-5.6.3.tar.gz" # https://pypi.org/project/psutil/#files - - "cdiff-1.0.tar.gz" # https://pypi.org/project/cdiff/#files -patroni_pip_package_file: - - "patroni-1.6.0.tar.gz" # https://pypi.org/project/patroni/#files - -# ( if installation_method: "file" and patroni_installation_type: "deb") -patroni_deb_package_file: "patroni_2.1.4-2.pgdg22.04+1_all.deb" # (package for Ubuntu 22.04) https://apt.postgresql.org/pub/repos/apt/pool/main/p/patroni/ + +# if installation_method: "file" and patroni_installation_method: "deb" +patroni_deb_package_file: "patroni_3.3.0-1.pgdg22.04%2B1_all.deb" +# (package for Ubuntu 22.04) https://apt.postgresql.org/pub/repos/apt/pool/main/p/patroni/ + +# if installation_method: "file" and patroni_installation_method: "pip" +pip_package_file: "pip-24.2.tar.gz" # https://pypi.org/project/pip/#files +patroni_pip_requirements_file: [] +# - "setuptools-41.2.0.zip" # https://pypi.org/project/setuptools/#files +# - "setuptools_scm-3.3.3.tar.gz" # https://pypi.org/project/setuptools-scm/#files +# - "urllib3-1.24.3.tar.gz" # https://pypi.org/project/urllib3/1.24.3/#files +# - "PyYAML-5.1.2.tar.gz" # https://pypi.org/project/PyYAML/#files +# - "chardet-3.0.4.tar.gz" # https://pypi.org/project/chardet/#files # (required for "requests") +# - "idna-2.8.tar.gz" # https://pypi.org/project/idna/#files # (required for "requests") +# - "certifi-2019.9.11.tar.gz" # https://pypi.org/project/certifi/#files # (required for "requests") +# - "requests-2.22.0.tar.gz" # https://pypi.org/project/requests/#files +# - "six-1.12.0.tar.gz" # https://pypi.org/project/six/#files +# - "kazoo-2.6.1.tar.gz" # https://pypi.org/project/kazoo/#files +# - "dnspython-1.16.0.zip" # https://pypi.org/project/dnspython/#files # (required for "python-etcd") +# - "python-etcd-0.4.5.tar.gz" # https://pypi.org/project/python-etcd/#files +# - "Click-7.0.tar.gz" # https://pypi.org/project/click/#files +# - "prettytable-0.7.2.tar.gz" # https://pypi.org/project/PrettyTable/#files +# - "pytz-2019.2.tar.gz" # https://pypi.org/project/pytz/#files # (required for "tzlocal") +# - "tzlocal-2.0.0.tar.gz" # https://pypi.org/project/tzlocal/#files +# - "wheel-0.33.6.tar.gz" # https://pypi.org/project/wheel/#files +# - "python-dateutil-2.8.0.tar.gz" # https://pypi.org/project/python-dateutil/#files +# - "psutil-5.6.3.tar.gz" # https://pypi.org/project/psutil/#files +# - "cdiff-1.0.tar.gz" # https://pypi.org/project/cdiff/#files +patroni_pip_package_file: [] +# - "patroni-3.3.2.tar.gz" # https://pypi.org/project/patroni/#files # additional packages -etcd_package_file: "etcd-v3.3.27-linux-amd64.tar.gz" # https://github.com/etcd-io/etcd/releases -wal_g_package_file: "wal-g.linux-amd64.tar.gz" # https://github.com/wal-g/wal-g/releases -vip_manager_package_file: "vip-manager_1.0.2-1_amd64.deb" # https://github.com/cybertec-postgresql/vip-manager/releases -# (if with_haproxy_load_balancing: true) +etcd_package_file: "etcd-v3.5.15-linux-amd64.tar.gz" # https://github.com/etcd-io/etcd/releases +vip_manager_package_file: "vip-manager_2.6.0_Linux_x86_64.deb" # https://github.com/cybertec-postgresql/vip-manager/releases +wal_g_package_file: "wal-g-pg-ubuntu20.04-aarch64.tar.gz" # https://github.com/wal-g/wal-g/releases + +# if with_haproxy_load_balancing: true haproxy_package_file: [] -# - "haproxy_1.8.21-1~bpo9+1_amd64.deb" +# - "haproxy_1.8.25-1~bpo9+1_amd64.deb" confd_package_file: "confd-0.16.0-linux-amd64" # https://github.com/kelseyhightower/confd/releases -# (optional) if haproxy_installation_method: 'src' + +# if haproxy_installation_method: 'src' (optional) lua_src_file: "lua-5.3.5.tar.gz" # https://www.lua.org/ftp/lua-5.3.5.tar.gz (required for build haproxy) -haproxy_src_file: "haproxy-1.8.20.tar.gz" # http://www.haproxy.org/download/1.8/src/ +haproxy_src_file: "haproxy-1.8.31.tar.gz" # http://www.haproxy.org/download/1.8/src/ # ------------------------------------------------------------------------------------------------- # # (optional) Specify additional deb packages if required (for any installation_method) diff --git a/vars/RedHat.yml b/vars/RedHat.yml index 693b770ea..fd680b970 100644 --- a/vars/RedHat.yml +++ b/vars/RedHat.yml @@ -29,7 +29,7 @@ install_postgresql_repo: true # or 'false' (installed from the package "pgdg-re install_scl_repo: true # or 'false' (Redhat 7 family only) # Packages (for yum repo) -python_version: "3.11" +python_version: "3" # override the version (e.q, 3.11) only if patroni_installation_method: "pip" is used os_specific_packages: RedHat-7: @@ -95,52 +95,32 @@ etcd_package_repo: "https://github.com/etcd-io/etcd/releases/download/v{{ etcd_v vip_manager_package_repo: "https://github.com/cybertec-postgresql/vip-manager/releases/download/v{{ vip_manager_version }}/vip-manager_{{ vip_manager_version }}_Linux_x86_64.rpm" -# (if with_haproxy_load_balancing: true) -haproxy_installation_method: "rpm" # (default)"rpm" or "src" -haproxy_install_repo: true # or 'false' # only for RedHat/CentOS version 7. -# For RedHat/CentOS/OracleLinux 7 the haproxy version 1.8 (LTS) -# will be installed from the "rh-haproxy18" package from the Software Collections (SCL) repository. -# You can preload the haproxy rpm packages to your YUM repository (in this case specify "haproxy_install_repo: false"). -confd_package_repo: "https://github.com/kelseyhightower/confd/releases/download/v0.16.0/confd-0.16.0-linux-amd64" +installation_method: "repo" # "repo" (default) or "file" -# (optional) if haproxy_installation_method: 'src' -haproxy_major: "1.8" -haproxy_version: "1.8.25" # version to build from source -lua_src_repo: "https://www.lua.org/ftp/lua-5.3.5.tar.gz" # required for build haproxy -haproxy_src_repo: "https://www.haproxy.org/download/{{ haproxy_major }}/src/haproxy-{{ haproxy_version }}.tar.gz" -haproxy_compile_requirements: - - unzip - - gzip - - make - - gcc - - gcc-c++ - - pcre-devel - - zlib-devel - - readline-devel - - openssl - - openssl-devel - - openssl-libs - - systemd-devel +# The Patroni package will be installed from the rpm package by default. +# You also have the option of choosing an installation method using the pip package. +patroni_installation_method: "rpm" # "rpm" (default) or "pip" -# You can also use your own repository for extra packages. You need to preload all the packages and change this URLs. -installation_method: "repo" # (default)"repo" or "file" +# if patroni_installation_method: "pip" +patroni_install_version: "latest" # or a specific version (e.q., '3.3.2') -# Patroni package will be installed from the pip repository (by default). -# You also have the option of choosing an patroni installation method using the rpm package. -patroni_installation_method: "pip" # (default)"pip" or "rpm" # if patroni_installation_method: "rpm" patroni_packages: - patroni - - patroni-etcd + - patroni-{{ dcs_type }} + +# if patroni_installation_method: "rpm" (optional) +# You can preload the patroni rpm package to your YUM repository, or explicitly specify the path to the package in this variable: +patroni_rpm_package_repo: [] +# - "https://download.postgresql.org/pub/repos/yum/common/redhat/rhel-8-x86_64/patroni-3.3.2-1PGDG.rhel8.noarch.rpm" # (package for RHEL 8) -# (if patroni_installation_type: "pip") -# Packages from your repository will be used to install instead of the pip repository. +# if patroni_installation_method: "pip" (optional) +# Packages from your repository will be used to install. By default, it is installed from the public pip repository. pip_package_repo: "https://bootstrap.pypa.io/get-pip.py" # latest version pip3 for python3 (or use "pip-.tar.gz"). patroni_pip_requirements_repo: [] # - "http://my-repo.url/setuptools-41.2.0.zip" # - "http://my-repo.url/setuptools_scm-3.3.3.tar.gz" # - "http://my-repo.url/urllib3-1.24.3.tar.gz" -# - "http://my-repo.url/boto-2.49.0.tar.gz" # (interfaces to Amazon Web Services) # - "http://my-repo.url/PyYAML-5.1.2.tar.gz" # - "http://my-repo.url/chardet-3.0.4.tar.gz" # - "http://my-repo.url/idna-2.8.tar.gz" @@ -161,60 +141,84 @@ patroni_pip_requirements_repo: [] patroni_pip_package_repo: [] # - "http://my-repo.url/patroni-1.6.0.tar.gz" -# (if patroni_installation_type: "rpm") -# You can preload the patroni rpm package to your YUM repository, or explicitly specify the path to the package in this variable: -patroni_rpm_package_repo: [] -# - "https://download.postgresql.org/pub/repos/yum/common/redhat/rhel-8-x86_64/patroni-2.1.4-1.rhel8.x86_64.rpm" # (package for RHEL/CentOS 8) +# if with_haproxy_load_balancing: true +haproxy_installation_method: "rpm" # "rpm" (default) or "src" +haproxy_install_repo: true # or 'false' # only for RedHat/CentOS version 7. +# For RedHat/CentOS/OracleLinux 7 the haproxy version 1.8 (LTS) +# will be installed from the "rh-haproxy18" package from the Software Collections (SCL) repository. +# You can preload the haproxy rpm packages to your YUM repository (in this case specify "haproxy_install_repo: false"). +confd_package_repo: "https://github.com/kelseyhightower/confd/releases/download/v0.16.0/confd-0.16.0-linux-amd64" + +# if haproxy_installation_method: 'src' (optional) +haproxy_major: "1.8" +haproxy_version: "1.8.31" # version to build from source +lua_src_repo: "https://www.lua.org/ftp/lua-5.3.5.tar.gz" # required for build haproxy +haproxy_src_repo: "https://www.haproxy.org/download/{{ haproxy_major }}/src/haproxy-{{ haproxy_version }}.tar.gz" +haproxy_compile_requirements: + - unzip + - gzip + - make + - gcc + - gcc-c++ + - pcre-devel + - zlib-devel + - readline-devel + - openssl + - openssl-devel + - openssl-libs + - systemd-devel # ================================================================================================= # -# (optional) if installation_method: "file" +# Offline installation (if installation_method: "file") +# # You can also download the necessary packages into postgresql_cluster/files/ directory. # Packages from this directory will be used for installation. -pip_package_file: "pip-19.2.3.tar.gz" # https://pypi.org/project/pip/#files -patroni_pip_requirements_file: - - "setuptools-41.2.0.zip" # https://pypi.org/project/setuptools/#files - - "setuptools_scm-3.3.3.tar.gz" # https://pypi.org/project/setuptools-scm/#files - - "urllib3-1.24.3.tar.gz" # https://pypi.org/project/urllib3/1.24.3/#files - - "boto-2.49.0.tar.gz" # https://pypi.org/project/boto/#files # (interfaces to Amazon Web Services) - - "PyYAML-5.1.2.tar.gz" # https://pypi.org/project/PyYAML/#files - - "chardet-3.0.4.tar.gz" # https://pypi.org/project/chardet/#files # (required for "requests") - - "idna-2.8.tar.gz" # https://pypi.org/project/idna/#files # (required for "requests") - - "certifi-2019.9.11.tar.gz" # https://pypi.org/project/certifi/#files # (required for "requests") - - "requests-2.22.0.tar.gz" # https://pypi.org/project/requests/#files - - "six-1.12.0.tar.gz" # https://pypi.org/project/six/#files - - "kazoo-2.6.1.tar.gz" # https://pypi.org/project/kazoo/#files - - "dnspython-1.16.0.zip" # https://pypi.org/project/dnspython/#files # (required for "python-etcd") - - "python-etcd-0.4.5.tar.gz" # https://pypi.org/project/python-etcd/#files - - "Click-7.0.tar.gz" # https://pypi.org/project/click/#files - - "prettytable-0.7.2.tar.gz" # https://pypi.org/project/PrettyTable/#files - - "pytz-2019.2.tar.gz" # https://pypi.org/project/pytz/#files # (required for "tzlocal") - - "tzlocal-2.0.0.tar.gz" # https://pypi.org/project/tzlocal/#files - - "wheel-0.33.6.tar.gz" # https://pypi.org/project/wheel/#files - - "python-dateutil-2.8.0.tar.gz" # https://pypi.org/project/python-dateutil/#files - - "psutil-5.6.3.tar.gz" # https://pypi.org/project/psutil/#files - - "cdiff-1.0.tar.gz" # https://pypi.org/project/cdiff/#files -patroni_pip_package_file: - - "patroni-1.6.0.tar.gz" # https://pypi.org/project/patroni/#files - -# ( if patroni_installation_type: "rpm" and installation_method: "file" ) -# (package for RHEL/CentOS 8) https://download.postgresql.org/pub/repos/yum/common/redhat/rhel-8-x86_64/ -patroni_rpm_package_file: "patroni-2.1.4-1.rhel8.x86_64.rpm" + +# if installation_method: "file" and patroni_installation_method: "rpm" +patroni_rpm_package_file: "patroni-3.3.2-1PGDG.rhel8.noarch.rpm" +# (package for RHEL 8) https://download.postgresql.org/pub/repos/yum/common/redhat/rhel-8-x86_64/ + +# if installation_method: "file" and patroni_installation_method: "pip" +pip_package_file: "pip-24.2.tar.gz" # https://pypi.org/project/pip/#files +patroni_pip_requirements_file: [] +# - "setuptools-41.2.0.zip" # https://pypi.org/project/setuptools/#files +# - "setuptools_scm-3.3.3.tar.gz" # https://pypi.org/project/setuptools-scm/#files +# - "urllib3-1.24.3.tar.gz" # https://pypi.org/project/urllib3/1.24.3/#files +# - "PyYAML-5.1.2.tar.gz" # https://pypi.org/project/PyYAML/#files +# - "chardet-3.0.4.tar.gz" # https://pypi.org/project/chardet/#files # (required for "requests") +# - "idna-2.8.tar.gz" # https://pypi.org/project/idna/#files # (required for "requests") +# - "certifi-2019.9.11.tar.gz" # https://pypi.org/project/certifi/#files # (required for "requests") +# - "requests-2.22.0.tar.gz" # https://pypi.org/project/requests/#files +# - "six-1.12.0.tar.gz" # https://pypi.org/project/six/#files +# - "kazoo-2.6.1.tar.gz" # https://pypi.org/project/kazoo/#files +# - "dnspython-1.16.0.zip" # https://pypi.org/project/dnspython/#files # (required for "python-etcd") +# - "python-etcd-0.4.5.tar.gz" # https://pypi.org/project/python-etcd/#files +# - "Click-7.0.tar.gz" # https://pypi.org/project/click/#files +# - "prettytable-0.7.2.tar.gz" # https://pypi.org/project/PrettyTable/#files +# - "pytz-2019.2.tar.gz" # https://pypi.org/project/pytz/#files # (required for "tzlocal") +# - "tzlocal-2.0.0.tar.gz" # https://pypi.org/project/tzlocal/#files +# - "wheel-0.33.6.tar.gz" # https://pypi.org/project/wheel/#files +# - "python-dateutil-2.8.0.tar.gz" # https://pypi.org/project/python-dateutil/#files +# - "psutil-5.6.3.tar.gz" # https://pypi.org/project/psutil/#files +# - "cdiff-1.0.tar.gz" # https://pypi.org/project/cdiff/#files +patroni_pip_package_file: [] +# - "patroni-3.3.2.tar.gz" # https://pypi.org/project/patroni/#files # additional packages -etcd_package_file: "etcd-v3.3.27-linux-amd64.tar.gz" # https://github.com/etcd-io/etcd/releases -wal_g_package_file: "wal-g.linux-amd64.tar.gz" # https://github.com/wal-g/wal-g/releases +etcd_package_file: "etcd-v3.5.15-linux-amd64.tar.gz" # https://github.com/etcd-io/etcd/releases vip_manager_package_file: "vip-manager-1.0.2-1.x86_64.rpm" # https://github.com/cybertec-postgresql/vip-manager/releases +wal_g_package_file: "wal-g.linux-amd64.tar.gz" # https://github.com/wal-g/wal-g/releases # if with_haproxy_load_balancing: true haproxy_package_file: [] # - "rh-haproxy18-runtime-3.1-2.el7.x86_64.rpm" -# - "rh-haproxy18-haproxy-1.8.17-1.el7.x86_64.rpm" +# - "rh-haproxy18-haproxy-1.8.31-1.el7.x86_64.rpm" confd_package_file: "confd-0.16.0-linux-amd64" # https://github.com/kelseyhightower/confd/releases -# (optional) if haproxy_installation_method: 'src' +# if haproxy_installation_method: 'src' (optional) lua_src_file: "lua-5.3.5.tar.gz" # https://www.lua.org/ftp/lua-5.3.5.tar.gz (required for build haproxy) -haproxy_src_file: "haproxy-1.8.21.tar.gz" # http://www.haproxy.org/download/1.8/src/ +haproxy_src_file: "haproxy-1.8.31.tar.gz" # http://www.haproxy.org/download/1.8/src/ # ------------------------------------------------------------------------------------------------- # # (optional) Specify additional rpm packages if required (for any installation_method) diff --git a/vars/main.yml b/vars/main.yml index 19decc77f..bafd1b5af 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -12,7 +12,6 @@ vip_interface: "{{ ansible_default_ipv4.interface }}" # interface name (e.g., " # Note: VIP-based solutions such as keepalived or vip-manager may not function correctly in cloud environments like AWS. patroni_cluster_name: "postgres-cluster" # the cluster name (must be unique for each cluster) -patroni_install_version: "3.3.2" # or 'latest' patroni_superuser_username: "postgres" patroni_superuser_password: "postgres-pass" # please change password @@ -112,7 +111,8 @@ patroni_etcd_protocol: "" # (optional) http or https, if not specified http is u # https://patroni.readthedocs.io/en/latest/yaml_configuration.html#consul # if dcs_type: "consul" -consul_version: "1.15.8" +consul_version: "latest" # or a specific version (e.q., '1.18.2') if 'consul_install_from_repo' is 'false' +consul_install_from_repo: true # specify 'false' only if patroni_installation_method: "pip" is used consul_config_path: "/etc/consul" consul_configd_path: "{{ consul_config_path }}/conf.d" consul_data_path: "/var/lib/consul"