Compare commits
No commits in common. "fix/more-resilient-postgresql-management" and "master" have entirely different histories.
fix/more-r
...
master
2 changed files with 3 additions and 29 deletions
17
playbook.yml
17
playbook.yml
|
@ -1,12 +1,12 @@
|
|||
---
|
||||
- name: Gathering user's configuration.
|
||||
- name: Initialising the playbook.
|
||||
hosts: all
|
||||
roles:
|
||||
- init
|
||||
tags:
|
||||
- always
|
||||
|
||||
- name: Installing and configuring the PostgreSQL engine.
|
||||
- name: Setting up the Pleroma database.
|
||||
hosts: pleroma_database
|
||||
become: yes
|
||||
become_method: sudo
|
||||
|
@ -14,19 +14,6 @@
|
|||
- pleroma-database
|
||||
tags:
|
||||
- pleroma-database
|
||||
vars:
|
||||
pleroma_database_installation: True
|
||||
|
||||
- name: Performing database administration.
|
||||
hosts: pleroma_database
|
||||
become: yes
|
||||
become_method: sudo
|
||||
roles:
|
||||
- pleroma-database
|
||||
tags:
|
||||
- pleroma-database
|
||||
vars:
|
||||
pleroma_database_administration: True
|
||||
|
||||
- name: Setting up Pleroma.
|
||||
hosts: pleroma_main
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
apk:
|
||||
name: "{{ pleroma_postgres_packages }}"
|
||||
state: present
|
||||
when: pleroma_database_installation | default(False)
|
||||
|
||||
- name: Postgres -- Ensure that the database is initialised.
|
||||
command:
|
||||
|
@ -11,7 +10,6 @@
|
|||
- /etc/init.d/postgresql
|
||||
- setup
|
||||
creates: /var/lib/postgresql/11/data/postgresql.conf
|
||||
when: pleroma_database_installation | default(False)
|
||||
|
||||
- name: Postgres -- Ensuring that the additional directories exist.
|
||||
file:
|
||||
|
@ -23,7 +21,6 @@
|
|||
loop:
|
||||
- "{{ pleroma_postgres_log_dir }}"
|
||||
- "{{ pleroma_postgres_confd }}"
|
||||
when: pleroma_database_installation | default(False)
|
||||
|
||||
- name: Postgres -- Ensuring that PostgreSQL is configured.
|
||||
template:
|
||||
|
@ -35,8 +32,6 @@
|
|||
loop:
|
||||
- { src: etc_postgresql_pg_hba.conf.j2, dest: "{{ pleroma_postgres_base_conf }}/pg_hba.conf" }
|
||||
- { src: etc_postgresql_confd_postgresql_override.conf, dest: "{{ pleroma_postgres_confd }}/postgresql_override.conf" }
|
||||
when: pleroma_database_installation | default(False)
|
||||
notify: "restart postgres"
|
||||
|
||||
- name: Postgres -- Ensuring that the symlink to the override config is present.
|
||||
file:
|
||||
|
@ -46,8 +41,6 @@
|
|||
path: "{{ pleroma_postgres_confd_symlink }}"
|
||||
src: "{{ pleroma_postgres_confd }}"
|
||||
state: link
|
||||
when: pleroma_database_installation | default(False)
|
||||
notify: "restart postgres"
|
||||
|
||||
- name: Postgres -- Ensuring that the override config is included in the main config.
|
||||
lineinfile:
|
||||
|
@ -58,14 +51,12 @@
|
|||
path: "{{ pleroma_postgres_base_conf }}/postgresql.conf"
|
||||
regexp: ^.*include\s=\s'.*'.*$
|
||||
state: present
|
||||
when: pleroma_database_installation | default(False)
|
||||
notify: "restart postgres"
|
||||
|
||||
- name: Postgres -- Ensuring that PostgreSQL is enabled and started.
|
||||
service:
|
||||
name: postgresql
|
||||
enabled: yes
|
||||
when: pleroma_database_installation | default(False)
|
||||
state: restarted
|
||||
|
||||
- name: Postgres -- Ensuring that Postgres is available before continuing.
|
||||
wait_for:
|
||||
|
@ -74,7 +65,6 @@
|
|||
host: localhost
|
||||
port: 5432
|
||||
state: started
|
||||
when: pleroma_database_administration | default(False)
|
||||
|
||||
- name: Postgres -- Ensuring that the database user {{ pleroma.config.db.user }} exists.
|
||||
become_user: postgres
|
||||
|
@ -87,7 +77,6 @@
|
|||
state: present
|
||||
vars:
|
||||
ansible_ssh_pipelining: true
|
||||
when: pleroma_database_administration | default(False)
|
||||
|
||||
- name: Postgres -- Ensuring that the database {{ pleroma.config.db.name }} exists.
|
||||
become_user: postgres
|
||||
|
@ -100,7 +89,6 @@
|
|||
state: present
|
||||
vars:
|
||||
ansible_ssh_pipelining: true
|
||||
when: pleroma_database_administration | default(False)
|
||||
|
||||
- name: Postgres -- Ensuring the PostgreSQL extensions is added to the database.
|
||||
become_user: postgres
|
||||
|
@ -115,4 +103,3 @@
|
|||
- uuid-ossp
|
||||
vars:
|
||||
ansible_ssh_pipelining: true
|
||||
when: pleroma_database_administration | default(False)
|
||||
|
|
Reference in a new issue