Skip to content

Commit

Permalink
Remove extension deployment tasks (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
teddyphreak authored Mar 15, 2024
1 parent 92489fb commit f69fd14
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 219 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ The following is the list of end-user serviceable parameters:

Global PostgreSQL configuration

| Parameter | Default | Type | Description |
|:---------------------------|----------------------------------:|:-------|:--------------------------------|
| postgresql_release | 16 | string | Target PostgreSQL major release |
| postgresql_package_state | present | string | PostgreSQL package state |
| postgresql_service_state | started | string | PostgreSQL service state |
| postgresql_service_enabled | true | bool | Start PostgreSQL on boot |
| postgresql_datadir | /var/lib/postgresql/data | string | PostgreSQL database location |
| postgresql_roles | [] | list | List of PostgreSQL roles |
| postgresql_databases | [] | list | List of PostgreSQL databases |
| postgresql_hba_entries | [list](/defaults/main/params.yml) | list | List of HBA entries |
| Parameter | Default | Type | Description |
|:---------------------------|-------------------------:|:-------|:--------------------------------|
| postgresql_release | 16 | string | Target PostgreSQL major release |
| postgresql_package_state | present | string | PostgreSQL package state |
| postgresql_service_state | started | string | PostgreSQL service state |
| postgresql_service_enabled | true | bool | Start PostgreSQL on boot |
| postgresql_datadir | /var/lib/postgresql/data | string | PostgreSQL database location |
| postgresql_roles | [] | list | List of PostgreSQL roles |
| postgresql_databases | [] | list | List of PostgreSQL databases |
| postgresql_hba_entries | [] | list | List of HBA entries |

Please refer to the [defaults directory](/defaults/main/) for an up to date list of input parameters.

Expand Down
20 changes: 1 addition & 19 deletions defaults/main/params.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,4 @@ postgresql_databases: []
postgresql_auth_method: md5 # [ scram-sha-256 | md5 ]
postgresql_default_database: postgres
postgresql_locale: en_US.UTF-8
postgresql_hba_entries:
- type: local
databases: all
users: postgres
method: peer
- type: local
databases: all
users: all
method: peer
- type: host
databases: all
users: all
address: '127.0.0.1/32'
method: "{{ postgresql_auth_method }}"
- type: host
databases: all
users: all
address: '::1/128'
method: "{{ postgresql_auth_method }}"
postgresql_hba_entries: []
22 changes: 0 additions & 22 deletions defaults/main/pgaudit.yml

This file was deleted.

7 changes: 0 additions & 7 deletions defaults/main/pgcron.yml

This file was deleted.

9 changes: 0 additions & 9 deletions defaults/main/pgstat_statements.yml

This file was deleted.

31 changes: 0 additions & 31 deletions molecule/common/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,34 +124,3 @@
loop_control:
label: "{{ item.name }}"
loop: "{{ postgresql_roles | default([]) | selectattr('groups', 'defined') }}"

- name: Query registered extensions
community.postgresql.postgresql_query:
query: "SELECT extname FROM pg_extension"
db: postgres
become: true
become_user: postgres
register: _extension_query

- name: Set extension facts
ansible.builtin.set_fact:
_registered_extensions: "{{ _registered }}"
_missing_extensions: "{{ _missing }}"
vars:
_registered: "{{ _extension_query.query_result | map(attribute='extname') }}"
_expected:
- pgaudit
- pg_cron
- pg_stat_statements
_missing: "{{ _expected | difference(_registered) }}"

- name: Verify registered extensions
block:
- name: Check registrations
ansible.builtin.assert:
that: _missing_extensions | length == 0

rescue:
- name: Debug failed extensions
ansible.builtin.fail:
msg: "Unable to find extensions [{{ ', '.join(_missing_extensions) }}]"
9 changes: 0 additions & 9 deletions tasks/extensions.yml

This file was deleted.

4 changes: 0 additions & 4 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,3 @@
- name: Manage PostgreSQL databases
ansible.builtin.include_tasks: databases.yml
when: postgresql_service_state == 'started'

- name: Manage PostgreSQL extensions
ansible.builtin.include_tasks: extensions.yml
when: postgresql_service_state == 'started'
37 changes: 0 additions & 37 deletions tasks/pgaudit.yml

This file was deleted.

34 changes: 0 additions & 34 deletions tasks/pgcron.yml

This file was deleted.

37 changes: 0 additions & 37 deletions tasks/pgstat_statements.yml

This file was deleted.

0 comments on commit f69fd14

Please sign in to comment.