initial ansible code

This commit is contained in:
Oli
2022-10-09 21:41:56 +00:00
parent 4a64eab4a0
commit feaec34dd2
103 changed files with 4473 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
---
- name: Add PostgreSQL GPG apt key
apt_key:
url: https://www.postgresql.org/media/keys/ACCC4CF8.asc
keyring: /usr/share/keyrings/apt.postgresql.org.gpg
state: present
- name: Add PostgreSQL Repository
apt_repository:
repo: "deb [arch={{ deb_architecture }} signed-by=/usr/share/keyrings/apt.postgresql.org.gpg] \
http://apt.postgresql.org/pub/repos/apt {{ ansible_distribution_release }}-pgdg main"
state: present
update_cache: true
- name: Install PostgreSQL
apt:
name: "postgresql-{{ pgsql_server_version }}"
state: latest
update_cache: true
cache_valid_time: 3600
- name: Create PostgreSQL Config
template:
dest: "/etc/postgresql/{{ pgsql_server_version }}/main/postgresql.conf"
src: "postgresql.conf.j2"
mode: 0644
notify: restart postgresql
- name: Create PostgreSQL Client Authentication Config
template:
dest: "/etc/postgresql/{{ pgsql_server_version }}/main/pg_hba.conf"
src: "pg_hba.conf.j2"
mode: 0644
notify: reload postgresql