Compare commits
1 Commits
transcaffe
...
2b315cdb9d
Author | SHA1 | Date | |
---|---|---|---|
2b315cdb9d
|
@ -1,13 +1,12 @@
|
|||||||
namespace: finallycoffee
|
namespace: finallycoffee
|
||||||
name: databases
|
name: databases
|
||||||
version: 0.1.2
|
version: 0.1.1
|
||||||
readme: README.md
|
readme: README.md
|
||||||
authors:
|
authors:
|
||||||
- transcaffeine <transcaffeine@finally.coffee>
|
- transcaffeine <transcaffeine@finally.coffee>
|
||||||
description: Collection for deploying and configuring databases
|
description: Collection for deploying and configuring databases
|
||||||
dependencies:
|
dependencies:
|
||||||
"community.docker": "^4.0.0"
|
"community.docker": "^3.0.0"
|
||||||
"community.postgresql": "^3.9.0"
|
|
||||||
license_file: LICENSE.md
|
license_file: LICENSE.md
|
||||||
build_ignore:
|
build_ignore:
|
||||||
- '*.tar.gz'
|
- '*.tar.gz'
|
||||||
|
@ -3,24 +3,6 @@
|
|||||||
PostgreSQL is the self proclaimed "world's most advanced" open source relational
|
PostgreSQL is the self proclaimed "world's most advanced" open source relational
|
||||||
database. This ansible role can deploy and configure postgresql.
|
database. This ansible role can deploy and configure postgresql.
|
||||||
|
|
||||||
By default, the role configures the remote's effective ansible user with
|
|
||||||
peer authentication for the (postgresql) role `postgres` on all databases (with all grants).
|
|
||||||
|
|
||||||
## Required configuration
|
|
||||||
|
|
||||||
Set `postgresql_superuser_password` to your superusers desired password.
|
|
||||||
|
|
||||||
## Optional configuration
|
|
||||||
|
|
||||||
Set `postgresql_major_version` to your desired postgresql major version,
|
|
||||||
for supported major versions see [`defaults/main/main.yml`](defaults/main/main.yml#L6).
|
|
||||||
|
|
||||||
This role can be executed multiple times with different
|
|
||||||
`postgresql_major_version` values to provide new database versions for up-to-
|
|
||||||
date applications and older versions for software which does not yet support
|
|
||||||
them. Container name and host mounts encode the major version to prevent
|
|
||||||
accidental usage of the 'wrong' `PGDATA` directory.
|
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
- `psycopg2` (pip) package
|
- `psycopg2` (pip) package
|
||||||
|
@ -50,7 +50,6 @@
|
|||||||
loop_control:
|
loop_control:
|
||||||
loop_var: result
|
loop_var: result
|
||||||
label: "{{ result.option.key }}"
|
label: "{{ result.option.key }}"
|
||||||
when: postgresql_state == 'present'
|
|
||||||
vars:
|
vars:
|
||||||
postgresql_login_host: >-2
|
postgresql_login_host: >-2
|
||||||
{{
|
{{
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Ensure postgresql package is {{ postgresql_state }}
|
|
||||||
ansible.builtin.package:
|
|
||||||
name: "{{ postgresql_os_package_name }}"
|
|
||||||
state: "{{ postgresql_state }}"
|
|
||||||
|
|
||||||
- name: Ensure postgresql systemd unit is {{ (postgresql_state == 'present') | ternary('enabled', 'disabled') }}
|
|
||||||
ansible.builtin.systemd:
|
|
||||||
name: "{{ postgresql_systemd_service_name }}"
|
|
||||||
enabled: "{{ (postgresql_state == 'present') }}"
|
|
||||||
when: ansible_facts['service_mgr'] == 'systemd'
|
|
@ -33,7 +33,6 @@
|
|||||||
loop:
|
loop:
|
||||||
- name: "{{ postgresql_config_path }}"
|
- name: "{{ postgresql_config_path }}"
|
||||||
- name: "{{ postgresql_data_path }}"
|
- name: "{{ postgresql_data_path }}"
|
||||||
mode: "0700"
|
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: path
|
loop_var: path
|
||||||
label: "{{ path.name }}"
|
label: "{{ path.name }}"
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
insert_after: "# Ansible managed"
|
insert_after: "# Ansible managed"
|
||||||
line: "{{ postgresql_admin_pg_ident_conf }}"
|
line: "{{ postgresql_admin_pg_ident_conf }}"
|
||||||
when: postgresql_state == 'present'
|
when: postgresql_state == 'present'
|
||||||
notify: postgresql_restart
|
|
||||||
|
|
||||||
- name: Configure permissions for postgresql admin role
|
- name: Configure permissions for postgresql admin role
|
||||||
community.postgresql.postgresql_pg_hba:
|
community.postgresql.postgresql_pg_hba:
|
||||||
@ -32,4 +31,3 @@
|
|||||||
method: "{{ postgresql_admin_role_method }}"
|
method: "{{ postgresql_admin_role_method }}"
|
||||||
options: "{{ postgresql_admin_pg_hba_conf_options }}"
|
options: "{{ postgresql_admin_pg_hba_conf_options }}"
|
||||||
when: postgresql_state == 'present'
|
when: postgresql_state == 'present'
|
||||||
notify: postgresql_restart
|
|
||||||
|
@ -4,4 +4,3 @@ postgresql_states:
|
|||||||
- absent
|
- absent
|
||||||
postgresql_deployment_methods:
|
postgresql_deployment_methods:
|
||||||
- docker
|
- docker
|
||||||
- local
|
|
||||||
|
Reference in New Issue
Block a user