Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
FactorT authored Aug 13, 2024
2 parents 52581e2 + cd180bb commit 8d40bce
Show file tree
Hide file tree
Showing 54 changed files with 547 additions and 777 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,12 @@ jobs:
- distro: debian11
tag: latest
namespace: geerlingguy
- distro: debian10
- distro: ubuntu2404
tag: latest
namespace: geerlingguy
- distro: ubuntu2204
tag: latest
namespace: geerlingguy
- distro: ubuntu2004
tag: latest
namespace: geerlingguy
- distro: rockylinux8
tag: latest
namespace: geerlingguy
Expand Down
32 changes: 0 additions & 32 deletions .github/workflows/schedule_pg_debian10.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: scheduled PostgreSQL (Ubuntu 20.04)
name: scheduled PostgreSQL (Ubuntu 24.04)

on:
schedule:
Expand Down Expand Up @@ -29,4 +29,4 @@ jobs:
env:
PY_COLORS: "1"
ANSIBLE_FORCE_COLOR: "1"
IMAGE_DISTRO: ubuntu2004
IMAGE_DISTRO: ubuntu2404
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ It requires the installation of a consul in client mode on each application serv
RedHat and Debian based distros (x86_64)

###### Supported Linux Distributions:
- **Debian**: 10, 11, 12
- **Ubuntu**: 20.04, 22.04
- **Debian**: 11, 12
- **Ubuntu**: 22.04, 24.04
- **CentOS Stream**: 9
- **Oracle Linux**: 8, 9
- **Rocky Linux**: 8, 9
Expand All @@ -103,11 +103,10 @@ all supported PostgreSQL versions
_Table of results of daily automated testing of cluster deployment:_
| Distribution | Test result |
|--------------|:----------:|
| Debian 10 | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/vitabaks/postgresql_cluster/schedule_pg_debian10.yml?branch=master)](https://github.com/vitabaks/postgresql_cluster/actions/workflows/schedule_pg_debian10.yml) |
| Debian 11 | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/vitabaks/postgresql_cluster/schedule_pg_debian11.yml?branch=master)](https://github.com/vitabaks/postgresql_cluster/actions/workflows/schedule_pg_debian11.yml) |
| Debian 12 | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/vitabaks/postgresql_cluster/schedule_pg_debian11.yml?branch=master)](https://github.com/vitabaks/postgresql_cluster/actions/workflows/schedule_pg_debian12.yml) |
| Ubuntu 20.04 | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/vitabaks/postgresql_cluster/schedule_pg_ubuntu2004.yml?branch=master)](https://github.com/vitabaks/postgresql_cluster/actions/workflows/schedule_pg_ubuntu2004.yml) |
| Ubuntu 22.04 | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/vitabaks/postgresql_cluster/schedule_pg_ubuntu2204.yml?branch=master)](https://github.com/vitabaks/postgresql_cluster/actions/workflows/schedule_pg_ubuntu2204.yml) |
| Ubuntu 24.04 | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/vitabaks/postgresql_cluster/schedule_pg_ubuntu2204.yml?branch=master)](https://github.com/vitabaks/postgresql_cluster/actions/workflows/schedule_pg_ubuntu2404.yml) |
| CentOS Stream 9 | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/vitabaks/postgresql_cluster/schedule_pg_centosstream9.yml?branch=master)](https://github.com/vitabaks/postgresql_cluster/actions/workflows/schedule_pg_centosstream9.yml) |
| Oracle Linux 8 | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/vitabaks/postgresql_cluster/schedule_pg_oracle_linux8.yml?branch=master)](https://github.com/vitabaks/postgresql_cluster/actions/workflows/schedule_pg_oracle_linux8.yml) |
| Oracle Linux 9 | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/vitabaks/postgresql_cluster/schedule_pg_oracle_linux9.yml?branch=master)](https://github.com/vitabaks/postgresql_cluster/actions/workflows/schedule_pg_oracle_linux9.yml) |
Expand Down
6 changes: 0 additions & 6 deletions add_balancer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@
any_errors_fatal: true
gather_facts: true
pre_tasks:
- name: "Set variable: ansible_python_interpreter"
ansible.builtin.set_fact:
ansible_python_interpreter: "/usr/bin/env python3"
when: "'python3' not in (ansible_python_interpreter | default(''))"
tags: always

- name: Include main variables
ansible.builtin.include_vars: "vars/main.yml"
tags: always
Expand Down
12 changes: 6 additions & 6 deletions add_pgnode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@
- ansible.builtin.import_tasks: roles/patroni/handlers/main.yml

pre_tasks:
- name: "Set variable: ansible_python_interpreter"
ansible.builtin.set_fact:
ansible_python_interpreter: "/usr/bin/env python3"
when: "'python3' not in (ansible_python_interpreter | default(''))"
tags: always

- name: Include main variables
ansible.builtin.include_vars: "vars/main.yml"
tags: always
Expand Down Expand Up @@ -122,6 +116,12 @@
- firewall_enabled_at_boot | bool
tags: firewall

- role: pre-checks
vars:
minimal_ansible_version: 2.11.0
timescale_minimal_pg_version: 12 # if enable_timescale is defined
tags: always

- role: sysctl
when:
- new_node | default(false) | bool
Expand Down
6 changes: 0 additions & 6 deletions balancers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@
vip_manager_disable: false # or 'true' for disable vip-manager service (if installed)

pre_tasks:
- name: "Set variable: ansible_python_interpreter"
ansible.builtin.set_fact:
ansible_python_interpreter: "/usr/bin/env python3"
when: "'python3' not in (ansible_python_interpreter | default(''))"
tags: always

- name: Include main variables
ansible.builtin.include_vars: "vars/main.yml"
tags: always
Expand Down
6 changes: 0 additions & 6 deletions config_pgcluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
hosts: postgres_cluster
gather_facts: true
pre_tasks:
- name: "Set variable: ansible_python_interpreter"
ansible.builtin.set_fact:
ansible_python_interpreter: "/usr/bin/env python3"
when: "'python3' not in (ansible_python_interpreter | default(''))"
tags: always

- name: Include main variables
ansible.builtin.include_vars: "vars/main.yml"

Expand Down
6 changes: 0 additions & 6 deletions consul.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@
environment: "{{ proxy_env | default({}) }}"

pre_tasks:
- name: "Set variable: ansible_python_interpreter"
ansible.builtin.set_fact:
ansible_python_interpreter: "/usr/bin/env python3"
when: "'python3' not in (ansible_python_interpreter | default(''))"
tags: always

- name: Include main variables
ansible.builtin.include_vars: "vars/main.yml"
tags: always
Expand Down
13 changes: 0 additions & 13 deletions deploy_pgcluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@
environment: "{{ proxy_env | default({}) }}"

pre_tasks:
- name: "Set variable: ansible_python_interpreter"
ansible.builtin.set_fact:
ansible_python_interpreter: "/usr/bin/env python3"
when: "'python3' not in (ansible_python_interpreter | default(''))"
tags: always

- name: Include main variables
ansible.builtin.include_vars: "vars/main.yml"
tags: always
Expand Down Expand Up @@ -62,17 +56,10 @@
tags: always

tasks:
- name: Clean yum cache
ansible.builtin.command: yum clean all
when:
- ansible_os_family == "RedHat"
- ansible_distribution_major_version == '7'

- name: Clean dnf cache
ansible.builtin.command: dnf clean all
when:
- ansible_os_family == "RedHat"
- ansible_distribution_major_version is version('8', '>=')

- name: Update apt cache
ansible.builtin.apt:
Expand Down
6 changes: 0 additions & 6 deletions etcd_cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@
gather_facts: true

pre_tasks:
- name: "Set variable: ansible_python_interpreter"
ansible.builtin.set_fact:
ansible_python_interpreter: "/usr/bin/env python3"
when: "'python3' not in (ansible_python_interpreter | default(''))"
tags: always

- name: Include main variables
ansible.builtin.include_vars: "vars/main.yml"
tags: always
Expand Down
1 change: 0 additions & 1 deletion files/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 12 additions & 5 deletions group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,17 @@ os_valid_distributions:
- AlmaLinux

os_minimum_versions:
RedHat: 7
CentOS: 7
RedHat: 8
CentOS: 8
Rocky: 8.4
OracleLinux: 7
Ubuntu: 20.04
Debian: 10
AlmaLinux: 8.3
OracleLinux: 8
Ubuntu: 22.04
Debian: 11

# Set correct interpreter for ansible-core
# Since ansible-core 2.17 (ansible 10 on pypi), ansible_python_interpreter wouldn't accept arguments anymore
# See:
# - https://github.com/ansible/ansible/issues/83476
# - https://github.com/ansible/ansible/issues/83603
ansible_python_interpreter: "{{ ansible_version['full'] is version('2.17', '>=') | ternary('/usr/bin/python3', '/usr/bin/env python3') }}"
2 changes: 1 addition & 1 deletion inventory
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ ansible_ssh_port='22'
ansible_user='root'
ansible_ssh_pass='secretpassword' # "sshpass" package is required for use "ansible_ssh_pass"
#ansible_ssh_private_key_file=
ansible_python_interpreter='/usr/bin/env python3'
#ansible_python_interpreter='/usr/bin/env python3'

[pgbackrest:vars]
#ansible_user='postgres'
Expand Down
13 changes: 10 additions & 3 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@
delegate_to: localhost
run_once: true # noqa run-once

# Consul package for OracleLinux 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"

- name: Set variables for custom PostgreSQL data and WAL directory test
ansible.builtin.set_fact:
postgresql_data_dir: "/pgdata/{{ postgresql_version }}/main"
Expand All @@ -41,9 +51,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:
Expand Down
15 changes: 11 additions & 4 deletions molecule/pg_upgrade/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,24 @@
delegate_to: localhost
run_once: true # noqa run-once

# Consul package for OracleLinux 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"

- name: Set variables for custom PostgreSQL data and WAL directory test
ansible.builtin.set_fact:
postgresql_data_dir: "/pgdata/{{ postgresql_version }}/main"
postgresql_wal_dir: "/pgwal/{{ postgresql_version }}/pg_wal"

- 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:
Expand Down
5 changes: 0 additions & 5 deletions pg_upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
become_user: postgres
any_errors_fatal: true
pre_tasks:
- name: "Set variable: ansible_python_interpreter"
ansible.builtin.set_fact:
ansible_python_interpreter: "/usr/bin/env python3"
when: "'python3' not in (ansible_python_interpreter | default(''))"

- name: Include main variables
ansible.builtin.include_vars: "vars/main.yml"

Expand Down
5 changes: 0 additions & 5 deletions pg_upgrade_rollback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@
gather_facts: true
any_errors_fatal: true
pre_tasks:
- name: "Set variable: ansible_python_interpreter"
ansible.builtin.set_fact:
ansible_python_interpreter: "/usr/bin/env python3"
when: "'python3' not in (ansible_python_interpreter | default(''))"

- name: Include main variables
ansible.builtin.include_vars: "vars/main.yml"
- name: Include upgrade variables
Expand Down
5 changes: 0 additions & 5 deletions remove_cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
hosts: postgres_cluster
become: true
pre_tasks:
- name: "Set variable: ansible_python_interpreter"
ansible.builtin.set_fact:
ansible_python_interpreter: "/usr/bin/env python3"
when: "'python3' not in (ansible_python_interpreter | default(''))"

- name: Include main variables
ansible.builtin.include_vars: "vars/main.yml"
- name: Include OS-specific variables
Expand Down
Loading

0 comments on commit 8d40bce

Please sign in to comment.