generated from ita-social-projects/DevTemplate
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
64b5c3a
commit a86a1a8
Showing
6 changed files
with
88 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
extends: default | ||
|
||
rules: | ||
line-length: | ||
max: 120 | ||
level: warning | ||
|
||
ignore: | | ||
.github/workflows/ci.yml | ||
.github/workflows/cd.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
become_user: root | ||
roles: | ||
- packages | ||
- postgresql |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
- name: restart postgresql | ||
service: | ||
name: postgresql | ||
state: restarted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
- name: Install packages | ||
apt: "name={{ item }} state=present" | ||
with_items: | ||
- postgresql | ||
- postgresql-server | ||
|
||
- name: Install Python packages | ||
pip: "name={{ item }} state=present" | ||
sudo: yes | ||
with_items: | ||
- postgresql-{{ postges_version }} | ||
- postgresql-client-{{ postges_version }} | ||
- postgresql-contrib-{{ postges_version }} | ||
|
||
- name: Configure PostgreSQL. Set listen_address | ||
lineinfile: dest=/etc/postgresql/{{ postges_version }}/main/postgresql.conf | ||
regexp="max_connections =" line="max_connections = 1000" state=present | ||
notify: restart postgresql | ||
sudo: yes | ||
|
||
- name: Configure PostgreSQL. Set SSL | ||
lineinfile: dest=/etc/postgresql/{{ postges_version }}/main/postgresql.conf | ||
regexp="ssl =" line="ssl = false" state=present | ||
notify: restart postgresql | ||
sudo: yes | ||
|
||
- name: Configure PostgreSQL. Set autovacuum | ||
lineinfile: dest=/etc/postgresql/{{ postges_version }}/main/postgresql.conf | ||
regexp="autovacuum =" line="autovacuum = on" state=present | ||
notify: restart postgresql | ||
sudo: yes | ||
|
||
- name: Configure PostgreSQL. Set hosts in pg_hba.conf | ||
template: | ||
src=pg_hba.conf.j2 dest=/etc/postgresql/{{ postgresql_version }}/main/pg_hba.conf | ||
backup=yes | ||
notify: restart postgresql | ||
sudo: yes | ||
|
||
- name: Install psycopg2 | ||
pip: name=psycopg2 | ||
sudo: yes | ||
|
||
- name: Create PostgreSQL DB | ||
postgresql_db: name={{ postgres_db_development_name }} | ||
sudo: yes | ||
sudo_user: { { postgres_user } } | ||
|
||
- name: Create PostgreSQL DB | ||
postgresql_db: name={{ postgres_db_test_name }} | ||
sudo: yes | ||
sudo_user: { { postgres_user } } | ||
|
||
- name: Include encrypted secrets | ||
include_vars: | ||
file: vars/secrets.yml | ||
|
||
- name: Create PostgreSQL user and grant access | ||
postgresql_user: db={{ postgres_db_development_name }} user={{ postgres_user }} password={{ postgres_user_password }} | ||
sudo: yes | ||
sudo_user: { { postgres_user } } | ||
|
||
- name: Run rake db:migrate | ||
shell: | | ||
rake db:migrate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
postgres_user: "postgres" | ||
postgres_db_development_name: "zero_waste_development" | ||
postgres_db_test_name: "zero_waste_test" | ||
postges_version: 12 |