feat: add variable postrgresql_primary

This commit is contained in:
Adrien Waksberg 2021-09-11 14:38:26 +02:00
parent 23ed17aad4
commit 6c4697df5e
5 changed files with 16 additions and 7 deletions

View file

@ -5,6 +5,10 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
## [Unreleased]
### Added
add variable postrgresql_primary
## v1.0.0 - 2021-09-10
- first version

View file

@ -14,13 +14,14 @@ Install and configure Postgresql
## Role variables
| Name | Type | Required |Default | Comment |
|------------------------------------|-------|----------|--------|--------------------------------------------------------|
| postgresql_version | str | no | 13 | the major version to use |
| postgresql_use_official_repository | bool | no | false | set to true if you want official postgresql repository |
| postgresql_config | dict | no | | add option config file |
| postgresql_databases | array | no | | the database to manage |
| postgresql_users | array | no | | the users to manage |
| Name | Type | Required |Default | Comment |
|------------------------------------|-------|----------|--------|-----------------------------------------------------|
| postgresql_version | str | no | 13 | the major version to use |
| postgresql_use_official_repository | bool | no | false | set true if you want official postgresql repository |
| postgresql_primary | bool | no | false | set true to create user and database on this server |
| postgresql_config | dict | no | | add option config file |
| postgresql_databases | array | no | | the database to manage |
| postgresql_users | array | no | | the users to manage |
### postgresql_config

View file

@ -1,6 +1,7 @@
---
postgresql_version: 13
postgresql_use_official_repository: false
postgresql_primary: false
postgresql_databases: []
postgresql_users: []
postgresql_config: {}

View file

@ -5,6 +5,7 @@
- ansible-role-postgresql
vars:
postgresql_use_official_repository: true
postgresql_primary: true
postgresql_config:
listen_addresses: '*'
postgresql_hba:

View file

@ -51,6 +51,7 @@
loop: '{{ postgresql_databases }}'
become: true
become_user: postgres
when: postgresql_primary
tags: postgresql
- name: manage users
@ -65,4 +66,5 @@
label: '{{ item.name }}/{{ item.database }}'
become: true
become_user: postgres
when: postgresql_primary
tags: postgresql