-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprovision_server.yml
57 lines (37 loc) · 1.16 KB
/
provision_server.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
- hosts: all
tasks:
- name: install all the required packages
sudo: yes
yum: name={{item}} state=present
with_items:
- ruby
- ruby-devel
- postgresql-server
- postgresql-devel
- curl
- rubygem-bundler
- rubygem-nokogiri
- python-psycopg2
- postgresql-contrib
# Database
- name: enable postgresql
command: systemctl enable postgresql
sudo: true
- name: initialize postgresql
command: /usr/bin/postgresql-setup initdb creates=/var/lib/pgsql/data/postgresql.conf
sudo: true
- name: copy updated pg_hba.conf file
copy: src=files/pg_hba.conf dest=/var/lib/pgsql/data/pg_hba.conf
sudo: true
- name: start postgresql
service: state=started name=postgresql
sudo: true
- name: create dev database
postgresql_db: name=agile-fishbowl state=present
sudo_user: postgres
sudo: true
- name: set username and password for database
postgresql_user: db=agile-fishbowl name=twer password=Thought01 priv=ALL state=present role_attr_flags=CREATEDB,CREATEROLE,SUPERUSER
sudo_user: postgres
sudo: true