Adding pgpass file for postgres, vagrant, and root user

parent 2a3c40dd
......@@ -12,7 +12,35 @@
become: true
become_user: postgres
- name: create password file on vagrant box
- name: create password file on vagrant box for postgres user
become: true
become_user: postgres
lineinfile:
dest: ~/.pgpass
state: present
create: yes
line: "{{ item }}"
mode: 0600
with_items:
- "#hostname:port:database:username:password"
- "localhost:5432:{{ db_name }}:{{ db_user }}:{{ db_user_pw }}"
- name: create password file on vagrant box for vagrant user
become: true
become_user: vagrant
lineinfile:
dest: ~/.pgpass
state: present
create: yes
line: "{{ item }}"
mode: 0600
with_items:
- "#hostname:port:database:username:password"
- "localhost:5432:{{ db_name }}:{{ db_user }}:{{ db_user_pw }}"
- name: create password file on vagrant box for root user
become: true
become_user: root
lineinfile:
dest: ~/.pgpass
state: present
......
Markdown is supported
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