Skip to content

Commit

Permalink
change config
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriiKhomik committed Dec 6, 2024
1 parent 7701f69 commit 5146671
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
20 changes: 6 additions & 14 deletions ansible1/roles/postgresql/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
---
- name: Install packages
- name: Ensure PostgreSQL Python libraries are installed.
apt:
name: "{{ item }}"
name: "{{ postgresql_python_library }}"
state: present
with_items:
- postgresql
- postgresql-server

- name: Install Python packages
pip:
name: "{{ item }}"
- name: Ensure PostgreSQL packages are installed.
apt:
name: "{{ postgresql_packages }}"
state: present
become: yes
with_items:
- postgresql-{{ postges_version }}
- postgresql-client-{{ postges_version }}
- postgresql-contrib-{{ postges_version }}

- name: Configure PostgreSQL. Set listen_address
lineinfile:
Expand All @@ -24,7 +16,7 @@
line: "max_connections = 1000"
state: present
notify: restart postgresql
sudo: yes
become: yes

- name: Configure PostgreSQL. Set SSL
lineinfile:
Expand Down
4 changes: 4 additions & 0 deletions ansible1/roles/postgresql/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ postgres_user: "postgres"
postgres_db_development_name: "zero_waste_development"
postgres_db_test_name: "zero_waste_test"
postges_version: 12
postgresql_packages:
- "postgresql"
- "postgresql-contrib"
postgresql_python_library: "python3-psycopg2"
postgresql_hba_entries:
- { type: local, database: all, user: postgres, auth_method: trust }
- { type: local, database: all, user: all, auth_method: md5 }
Expand Down

0 comments on commit 5146671

Please sign in to comment.