2017-11-26 21:52:17 +00:00
|
|
|
---
|
2017-11-26 21:50:14 +00:00
|
|
|
# This role installs the PostgreSQL server daemon and creates the mastodon
|
|
|
|
# database user
|
|
|
|
|
|
|
|
- name: Install PostgreSQL server and related packages
|
2019-07-22 00:49:06 +00:00
|
|
|
apt: name={{ packages }} state=latest update_cache=yes
|
2020-08-23 00:00:14 +00:00
|
|
|
when: ansible_distribution_release == 'bionic'
|
2019-07-22 00:49:06 +00:00
|
|
|
vars:
|
|
|
|
packages:
|
2017-11-26 21:50:14 +00:00
|
|
|
- postgresql
|
|
|
|
- postgresql-contrib
|
|
|
|
- python-psycopg2
|
2020-08-23 00:00:14 +00:00
|
|
|
- name: Install PostgreSQL server and related packages
|
|
|
|
apt: name={{ packages }} state=latest update_cache=yes
|
|
|
|
when: ansible_distribution_release == 'focal'
|
|
|
|
vars:
|
|
|
|
packages:
|
|
|
|
- postgresql
|
|
|
|
- postgresql-contrib
|
|
|
|
- python3-psycopg2
|
2017-11-26 21:50:14 +00:00
|
|
|
- name: Add Mastodon PostgreSQL database user
|
|
|
|
postgresql_user:
|
|
|
|
name: mastodon
|
|
|
|
role_attr_flags: CREATEDB
|
|
|
|
state: present
|
|
|
|
become: true
|
|
|
|
become_user: postgres
|
2018-08-23 20:53:25 +00:00
|
|
|
- name: Run PostgreSQL install tasks
|
|
|
|
include_tasks: install.yml
|
|
|
|
when: install is defined
|