Skip to content

Commit

Permalink
Merge pull request #8 from kevincoakley/15.0.0
Browse files Browse the repository at this point in the history
15.0.0
  • Loading branch information
kevincoakley authored Oct 18, 2022
2 parents f54d4f9 + 7e25d67 commit acca07a
Show file tree
Hide file tree
Showing 15 changed files with 176 additions and 19 deletions.
2 changes: 0 additions & 2 deletions .ansible-lint

This file was deleted.

9 changes: 6 additions & 3 deletions .github/workflows/molecule-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ jobs:
fail-fast: false
max-parallel: 4
matrix:
molecule_distro: ['centos7', 'centos8', 'ubuntu1804', 'ubuntu2004']
molecule_playbook: ['10', '11', '12']
molecule_distro: ['rockylinux8', 'ubuntu2004', 'ubuntu2204']
molecule_playbook: ['10', '11', '12', '13', '14', '15']
env:
ANSIBLE_CALLBACK_WHITELIST: profile_tasks

Expand All @@ -22,7 +22,10 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ansible-lint flake8 molecule docker
pip install ansible ansible-lint flake8 molecule molecule-docker docker yamllint
ansible --version
ansible-lint --version
molecule --version
- name: Test with molecule
run: |
molecule test --all
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ansible-role-postgres

![](https://github.com/kevincoakley/ansible-role-postgres/workflows/Molecule%20Test/badge.svg)

Install Postgres 10, 11 or 12. Tested with Postgres 10, 11 and 12 on CentOS 7, CentOS 8, Ubuntu 18.04, Ubuntu 20.04.
Install Postgres 10, 11, 12, 13, 14, & 15. Tested with Postgres 10, 11, 12, 13, 14, & 15 and CentOS 8, Ubuntu 20.04 & Ubuntu 22.04.

Requirements
------------
Expand Down
6 changes: 2 additions & 4 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
# Supported Postgresql Versions:
# CentOS 7: 10, 11 or 12
# Ubuntu 18.04: 10, 11 or 12
postgres_major_version: 12
# Supported Postgresql Versions: 10, 11, 12, 13, 14, & 15
postgres_major_version: 15
postgres_listen_addresses: localhost
postgres_client_auth: []
# postgres_client_auth takes five elements: type, database, user, address, method and absent (optional).
Expand Down
10 changes: 5 additions & 5 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
galaxy_info:
role_name: postgres
namespace: kevincoakley
author: Kevin Coakley
description: Install Postgres 10, 11 or 12
description: Install Postgres 10, 11, 12, 13, 14, or 15

# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
Expand All @@ -17,20 +18,19 @@ galaxy_info:
# - CC-BY
license: BSD

min_ansible_version: 2.5
min_ansible_version: "2.5"

#
# platforms is a list of platforms, and each platform has a name and a list of versions.
#
platforms:
- name: EL
versions:
- 7
- 8
- "8"
- name: Ubuntu
versions:
- bionic
- focal
- jammy

galaxy_tags:
- database
Expand Down
8 changes: 8 additions & 0 deletions molecule/ansible-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
warn_list:
- internal-error
- role-name
- fqcn-builtins
- no-tabs
skip_list:
- yaml
21 changes: 21 additions & 0 deletions molecule/default/converge-13.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
- name: Converge
hosts: all
become: true

vars:
- postgres_major_version: 13
- postgres_listen_addresses: "*"
- postgres_client_auth:
- type: host
database: all
user: all
address: 0.0.0.0/0
method: md5
- type: local
database: all
user: all
method: md5

roles:
- role: ansible-role-postgres
21 changes: 21 additions & 0 deletions molecule/default/converge-14.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
- name: Converge
hosts: all
become: true

vars:
- postgres_major_version: 14
- postgres_listen_addresses: "*"
- postgres_client_auth:
- type: host
database: all
user: all
address: 0.0.0.0/0
method: md5
- type: local
database: all
user: all
method: md5

roles:
- role: ansible-role-postgres
21 changes: 21 additions & 0 deletions molecule/default/converge-15.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
- name: Converge
hosts: all
become: true

vars:
- postgres_major_version: 15
- postgres_listen_addresses: "*"
- postgres_client_auth:
- type: host
database: all
user: all
address: 0.0.0.0/0
method: md5
- type: local
database: all
user: all
method: md5

roles:
- role: ansible-role-postgres
8 changes: 4 additions & 4 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ driver:
lint: |
set -e
yamllint -c molecule/yaml-lint.yml .
ansible-lint
ansible-lint -c molecule/ansible-lint.yml .
flake8
platforms:
- name: instance
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest"
image: "geerlingguy/docker-${MOLECULE_DISTRO:-rockylinux8}-ansible:latest"
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
Expand All @@ -22,8 +22,8 @@ provisioner:
options:
vvv: false
playbooks:
converge: "converge-${MOLECULE_PLAYBOOK:-11}.yml"
verify: "verify-${MOLECULE_PLAYBOOK:-11}.yml"
converge: "converge-${MOLECULE_PLAYBOOK:-15}.yml"
verify: "verify-${MOLECULE_PLAYBOOK:-15}.yml"
scenario:
name: default
verifier:
Expand Down
17 changes: 17 additions & 0 deletions molecule/default/verify-13.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
- name: Verify
hosts: all
become: true

tasks:
- name: Test if the postgres 13 is running
shell: psql -c "SELECT version();"
args:
executable: /bin/bash
register: postgresql_version
become: true
become_user: postgres
become_method: sudo
changed_when: false
failed_when:
- '"PostgreSQL 13" not in postgresql_version.stdout'
17 changes: 17 additions & 0 deletions molecule/default/verify-14.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
- name: Verify
hosts: all
become: true

tasks:
- name: Test if the postgres 14 is running
shell: psql -c "SELECT version();"
args:
executable: /bin/bash
register: postgresql_version
become: true
become_user: postgres
become_method: sudo
changed_when: false
failed_when:
- '"PostgreSQL 14" not in postgresql_version.stdout'
17 changes: 17 additions & 0 deletions molecule/default/verify-15.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
- name: Verify
hosts: all
become: true

tasks:
- name: Test if the postgres 15 is running
shell: psql -c "SELECT version();"
args:
executable: /bin/bash
register: postgresql_version
become: true
become_user: postgres
become_method: sudo
changed_when: false
failed_when:
- '"PostgreSQL 15" not in postgresql_version.stdout'
15 changes: 15 additions & 0 deletions vars/Debian.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
---
postgresql_packages:
15:
- postgresql-15
14:
- postgresql-14
13:
- postgresql-13
12:
- postgresql-12
11:
Expand All @@ -8,14 +14,23 @@ postgresql_packages:
- postgresql-10

postgresql_service:
15: postgresql
14: postgresql
13: postgresql
12: postgresql
11: postgresql
10: postgresql
postgresql_data_path:
15: /var/lib/postgresql/15/main
14: /var/lib/postgresql/14/main
13: /var/lib/postgresql/13/main
12: /var/lib/postgresql/12/main
11: /var/lib/postgresql/11/main
10: /var/lib/postgresql/10/main
postgresql_conf_path:
15: /etc/postgresql/15/main
14: /etc/postgresql/14/main
13: /etc/postgresql/13/main
12: /etc/postgresql/12/main
11: /etc/postgresql/11/main
10: /etc/postgresql/10/main
21 changes: 21 additions & 0 deletions vars/RedHat.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
---
postgresql_packages:
15:
- postgresql15-server
- postgresql15
14:
- postgresql14-server
- postgresql14
13:
- postgresql13-server
- postgresql13
12:
- postgresql12-server
- postgresql12
Expand All @@ -11,18 +20,30 @@ postgresql_packages:
- postgresql10

postgresql_service:
15: postgresql-15
14: postgresql-14
13: postgresql-13
12: postgresql-12
11: postgresql-11
10: postgresql-10
postgresql_setup_path:
15: /usr/pgsql-15/bin/postgresql-15-setup
14: /usr/pgsql-14/bin/postgresql-14-setup
13: /usr/pgsql-13/bin/postgresql-13-setup
12: /usr/pgsql-12/bin/postgresql-12-setup
11: /usr/pgsql-11/bin/postgresql-11-setup
10: /usr/pgsql-10/bin/postgresql-10-setup
postgresql_data_path:
15: /var/lib/pgsql/15/data
14: /var/lib/pgsql/14/data
13: /var/lib/pgsql/13/data
12: /var/lib/pgsql/12/data
11: /var/lib/pgsql/11/data
10: /var/lib/pgsql/10/data
postgresql_conf_path:
15: /var/lib/pgsql/15/data
14: /var/lib/pgsql/14/data
13: /var/lib/pgsql/13/data
12: /var/lib/pgsql/12/data
11: /var/lib/pgsql/11/data
10: /var/lib/pgsql/10/data

0 comments on commit acca07a

Please sign in to comment.