Update to 2022-01-25 13:00

This commit is contained in:
Daniel Berteaud 2022-01-25 13:00:05 +01:00
parent bc89de8f63
commit 44ee2cb941
3 changed files with 25 additions and 0 deletions

View File

@ -39,6 +39,10 @@ pg_base_conf:
pg_extra_conf: {}
pg_conf: "{{ pg_base_conf | combine(pg_extra_conf, recursive=True) }}"
# If pg_monitoring_user and pg_monitoring_pass are defined, a user will be created
# Made for Zabbix
# pg_monitoring_user: zbx
# pg_monitoring_pass: S3cr3t.
# Databases and roles to create
# Eg

View File

@ -108,6 +108,26 @@
with_items: "{{ pg_roles }}"
tags: pg
- when: pg_monitoring_user is defined and pg_monitoring_pass is defined
block:
- name: Create monitoring user
postgresql_user:
name: "{{ pg_monitoring_user }}"
password: "{{ pg_monitoring_pass }}"
- name: Grant privileges for monitoring user
postgresql_privs:
type: function
state: present
privs: EXECUTE
schema: pg_catalog
objs: pg_ls_dir(text),pg_stat_file(text),pg_ls_waldir()
role: "{{ pg_monitoring_user }}"
database: postgres
become_user: postgres
tags: pg,zabbix
- name: Create databases
postgresql_db:
name: "{{ item.name }}"

View File

@ -4,6 +4,7 @@
shell: ls -1 /etc/ssh/authorized_keys | xargs -n1 basename
register: existing_ssh_keys
changed_when: False
failed_when: False # The task can fail if there's no key yet
tags: ssh
- name: Remove unmanaged ssh keys