Skip to content
Snippets Groups Projects
Commit 2b187a7e authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

add installation of postgresql to ansible

Former-commit-id: 98c2fdffc27eaa33855579fc512db794430d84dc
parent 0f1940de
No related branches found
No related tags found
No related merge requests found
...@@ -48,6 +48,29 @@ ...@@ -48,6 +48,29 @@
name: "@Development tools" name: "@Development tools"
state: present state: present
become: true become: true
- name: install PostgreSQL
yum:
name: "postgresql-server"
state: present
become: true
- name: Initiate database
command: service postgresql initdb
creates=/var/lib/pgsql/data/postgresql.conf
- name: Start PostgreSQL and enable at boot
service: name=postgresql
enabled=yes
state=started
- name: Ensure PostgreSQL is listening on all localhost
lineinfile: dest=/var/lib/pgsql/data/postgresql.conf
regexp='^#?listen_addresses\s*='
line="listen_addresses = '127.0.0.1'"
state=present
- lineinfile: dest=/var/lib/pgsql/data/pg_hba.conf
regexp='host\s+all\s+all\s+127.0.0.1/32\s+md5'
line='host all all 127.0.0.1/32 md5'
insertbefore=BOF
- name: restart postgresql service
systemd: state=restarted name=postgresql enabled=yes
# #
# Stop web server(s) # Stop web server(s)
# #
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment