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

ansible postgresql wip

- copy pg_hba.conf from repository
- create database in postgresql

Former-commit-id: b97e17036e31be27b80b0446a91a3c09e5ce2873
parent 89d35579
No related branches found
No related tags found
No related merge requests found
......@@ -64,21 +64,23 @@
command: service postgresql initdb
args:
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 = '*'"
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: copy pg_hba.conf file
copy:
remote_src: true
src: /home/{{ deploy_user_name }}/iPPIDB/ansible/pg_hba.conf
dest: /var/lib/pgsql/data/pg_hba.conf
owner: postgres
group: postgres
- name: restart postgresql service
systemd: state=restarted name=postgresql enabled=yes
- postgresql_db:
name: {{ dbname }}
owner: {{ dbuser }}
- name: create db user
become_user: "postgres"
postgresql_user:
......
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