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 @@ ...@@ -64,21 +64,23 @@
command: service postgresql initdb command: service postgresql initdb
args: args:
creates: /var/lib/pgsql/data/postgresql.conf 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 - name: Ensure PostgreSQL is listening on all localhost
lineinfile: dest=/var/lib/pgsql/data/postgresql.conf lineinfile: dest=/var/lib/pgsql/data/postgresql.conf
regexp='^#?listen_addresses\s*=' regexp='^#?listen_addresses\s*='
line="listen_addresses = '*'" line="listen_addresses = '*'"
state=present state=present
- lineinfile: dest=/var/lib/pgsql/data/pg_hba.conf - name: copy pg_hba.conf file
regexp='host\s+all\s+all\s+127.0.0.1/32\s+md5' copy:
line='host all all 127.0.0.1/32 md5' remote_src: true
insertbefore=BOF 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 - name: restart postgresql service
systemd: state=restarted name=postgresql enabled=yes systemd: state=restarted name=postgresql enabled=yes
- postgresql_db:
name: {{ dbname }}
owner: {{ dbuser }}
- name: create db user - name: create db user
become_user: "postgres" become_user: "postgres"
postgresql_user: 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