feat: add variable postrgresql_primary
This commit is contained in:
parent
23ed17aad4
commit
6c4697df5e
5 changed files with 16 additions and 7 deletions
|
@ -5,6 +5,10 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
add variable postrgresql_primary
|
||||||
|
|
||||||
## v1.0.0 - 2021-09-10
|
## v1.0.0 - 2021-09-10
|
||||||
|
|
||||||
- first version
|
- first version
|
||||||
|
|
15
README.md
15
README.md
|
@ -14,13 +14,14 @@ Install and configure Postgresql
|
||||||
|
|
||||||
## Role variables
|
## Role variables
|
||||||
|
|
||||||
| Name | Type | Required |Default | Comment |
|
| Name | Type | Required |Default | Comment |
|
||||||
|------------------------------------|-------|----------|--------|--------------------------------------------------------|
|
|------------------------------------|-------|----------|--------|-----------------------------------------------------|
|
||||||
| postgresql_version | str | no | 13 | the major version to use |
|
| 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_use_official_repository | bool | no | false | set true if you want official postgresql repository |
|
||||||
| postgresql_config | dict | no | | add option config file |
|
| postgresql_primary | bool | no | false | set true to create user and database on this server |
|
||||||
| postgresql_databases | array | no | | the database to manage |
|
| postgresql_config | dict | no | | add option config file |
|
||||||
| postgresql_users | array | no | | the users to manage |
|
| postgresql_databases | array | no | | the database to manage |
|
||||||
|
| postgresql_users | array | no | | the users to manage |
|
||||||
|
|
||||||
### postgresql_config
|
### postgresql_config
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
---
|
---
|
||||||
postgresql_version: 13
|
postgresql_version: 13
|
||||||
postgresql_use_official_repository: false
|
postgresql_use_official_repository: false
|
||||||
|
postgresql_primary: false
|
||||||
postgresql_databases: []
|
postgresql_databases: []
|
||||||
postgresql_users: []
|
postgresql_users: []
|
||||||
postgresql_config: {}
|
postgresql_config: {}
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
- ansible-role-postgresql
|
- ansible-role-postgresql
|
||||||
vars:
|
vars:
|
||||||
postgresql_use_official_repository: true
|
postgresql_use_official_repository: true
|
||||||
|
postgresql_primary: true
|
||||||
postgresql_config:
|
postgresql_config:
|
||||||
listen_addresses: '*'
|
listen_addresses: '*'
|
||||||
postgresql_hba:
|
postgresql_hba:
|
||||||
|
|
|
@ -51,6 +51,7 @@
|
||||||
loop: '{{ postgresql_databases }}'
|
loop: '{{ postgresql_databases }}'
|
||||||
become: true
|
become: true
|
||||||
become_user: postgres
|
become_user: postgres
|
||||||
|
when: postgresql_primary
|
||||||
tags: postgresql
|
tags: postgresql
|
||||||
|
|
||||||
- name: manage users
|
- name: manage users
|
||||||
|
@ -65,4 +66,5 @@
|
||||||
label: '{{ item.name }}/{{ item.database }}'
|
label: '{{ item.name }}/{{ item.database }}'
|
||||||
become: true
|
become: true
|
||||||
become_user: postgres
|
become_user: postgres
|
||||||
|
when: postgresql_primary
|
||||||
tags: postgresql
|
tags: postgresql
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue