From 5265db132c50ac18a85df6289b84a64805bc7226 Mon Sep 17 00:00:00 2001 From: staticsafe Date: Sun, 26 Nov 2017 16:50:14 -0500 Subject: [PATCH] Add mastodon-postgresql role. --- roles/mastodon-postgresql/tasks/main.yml | 17 +++++++++++++++++ site.yml | 1 + 2 files changed, 18 insertions(+) create mode 100644 roles/mastodon-postgresql/tasks/main.yml diff --git a/roles/mastodon-postgresql/tasks/main.yml b/roles/mastodon-postgresql/tasks/main.yml new file mode 100644 index 0000000..55a557e --- /dev/null +++ b/roles/mastodon-postgresql/tasks/main.yml @@ -0,0 +1,17 @@ +-- +# This role installs the PostgreSQL server daemon and creates the mastodon +# database user + +- name: Install PostgreSQL server and related packages + apt: name={{ item }} state=latest update_cache=yes + with_items: + - postgresql + - postgresql-contrib + - python-psycopg2 +- name: Add Mastodon PostgreSQL database user + postgresql_user: + name: mastodon + role_attr_flags: CREATEDB + state: present + become: true + become_user: postgres diff --git a/site.yml b/site.yml index 9503f0f..35cc788 100644 --- a/site.yml +++ b/site.yml @@ -5,3 +5,4 @@ - common - ruby - mastodon-app + - mastodon-postgresql