Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add db and role management flags #20

Merged
merged 1 commit into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Global PostgreSQL configuration
| postgresql_conf_main_manage | true | list | Toggle flag for postgresql.conf management | false |
| postgresql_conf_hba_manage | true | list | Toggle flag for pg_hba.conf management | false |
| postgresql_conf_ident_manage | true | list | Toggle flag for pg_ident.conf management | false |
| postgresql_role_manage | true | list | Toggle flag for role management | false |
| postgresql_datrabase_manage | true | list | Toggle flag for database management | false |

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

Expand Down
2 changes: 2 additions & 0 deletions defaults/main/params.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ postgresql_locale: en_US.UTF-8
postgresql_conf_main_manage: true
postgresql_conf_hba_manage: true
postgresql_conf_ident_manage: true
postgresql_role_manage: "{{ postgresql_service_state == 'started' }}"
postgresql_database_manage: "{{ postgresql_service_state == 'started' }}"
postgresql_ident_entries: []
postgresql_hba_entries:
- type: "host"
Expand Down
4 changes: 2 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

- name: Manage PostgreSQL roles
ansible.builtin.include_tasks: roles.yml
when: postgresql_service_state == 'started'
when: postgresql_role_manage | bool

- name: Manage PostgreSQL databases
ansible.builtin.include_tasks: databases.yml
when: postgresql_service_state == 'started'
when: postgresql_database_manage | bool