2020-12-21 01:18:32 -06:00
|
|
|
#!/usr/bin/env ansible-playbook
|
|
|
|
# vim:ft=ansible:
|
|
|
|
# Database servers
|
|
|
|
---
|
|
|
|
- hosts: psql1.desu.ltd
|
|
|
|
roles:
|
2020-12-24 09:19:12 -06:00
|
|
|
- role: backup
|
|
|
|
vars:
|
2020-12-24 09:36:39 -06:00
|
|
|
backup_script: s3pgdump
|
2020-12-24 09:19:12 -06:00
|
|
|
become: yes
|
|
|
|
tags: [ backup ]
|
2020-12-21 01:18:32 -06:00
|
|
|
- role: postgresql
|
|
|
|
vars:
|
|
|
|
postgresql_global_config_options:
|
|
|
|
- option: listen_addresses
|
|
|
|
value: 192.168.164.156
|
|
|
|
postgresql_hba_entries:
|
|
|
|
- { type: local, database: all, user: postgres, auth_method: peer }
|
|
|
|
- { type: local, database: all, user: all, auth_method: peer }
|
|
|
|
- { type: host, database: all, user: all, address: '127.0.0.1/32', auth_method: md5 }
|
|
|
|
- { type: host, database: all, user: all, address: '::1/128', auth_method: md5 }
|
|
|
|
# Used for internal access from other nodes
|
|
|
|
- { type: host, database: all, user: all, address: '192.168.0.0/16', auth_method: md5 }
|
|
|
|
postgresql_users:
|
|
|
|
- name: gitea
|
|
|
|
password: "{{ secret_gitea_db_pass }}"
|
|
|
|
- name: nextcloud
|
|
|
|
password: "{{ secret_nextcloud_db_pass }}"
|
|
|
|
postgresql_databases:
|
|
|
|
- name: gitea
|
|
|
|
owner: gitea
|
|
|
|
- name: nextcloud
|
|
|
|
owner: nextcloud
|
|
|
|
become: yes
|
|
|
|
tags: [ db, psql ]
|
2020-12-27 12:07:55 -06:00
|
|
|
- hosts: psql1.9iron.club
|
|
|
|
roles:
|
|
|
|
- role: backup
|
|
|
|
vars:
|
|
|
|
backup_script: s3pgdump
|
|
|
|
become: yes
|
|
|
|
tags: [ backup ]
|
|
|
|
- role: postgresql
|
|
|
|
vars:
|
|
|
|
postgresql_hba_entries:
|
|
|
|
- { type: local, database: all, user: postgres, auth_method: peer }
|
|
|
|
- { type: local, database: all, user: all, auth_method: peer }
|
|
|
|
- { type: host, database: all, user: all, address: '127.0.0.1/32', auth_method: md5 }
|
|
|
|
- { type: host, database: all, user: all, address: '::1/128', auth_method: md5 }
|
|
|
|
- { type: host, database: all, user: all, address: '172.31.0.0/16', auth_method: md5 }
|
|
|
|
become: yes
|
|
|
|
tags: [ db, psql ]
|