SHARE
TWEET

Untitled

a guest Sep 21st, 2016 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ---
  2. - hosts: kmt
  3.   become_user: root
  4.   become: yes
  5.   gather_facts: no
  6.   remote_user: vagrant
  7.  
  8.   tasks:
  9.   - name: Install postgres database
  10.     apt:
  11.       name: "{{item}}"
  12.       state: installed
  13.     with_items:
  14.       - postgresql
  15.       - libpq-dev
  16.       - python-psycopg2
  17.  
  18. - hosts: kmt
  19.   become: yes
  20.   become_user: postgres
  21.   gather_facts: no
  22.  
  23.   vars:
  24.     dbname: kmt_prod
  25.     dbuser: nguyenvinhlinh
  26.     dbpassword: nguyenvinhlinh
  27.  
  28.   tasks:
  29.   - name: make database
  30.     postgresql_db: name={{dbname}}
  31.  
  32.   - name: ensure user has access to database
  33.     postgresql_user: db={{dbname}} name={{dbuser}} password={{dbpassword}} priv=ALL
  34.  
  35.   - name: ensure user does not have unnecessary privilege
  36.     postgresql_user: name={{dbuser}} role_attr_flags=NOSUPERUSER,NOCREATEDB
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top