Advertisement
Guest User

Untitled

a guest
Jun 28th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. exec { 'create db urutau':
  2. user => "postgres",
  3. command => "/usr/bin/createdb -O urutau urutau",
  4. path => "/home/pet",
  5. unless => "/usr/bin/psql -lqt | /usr/bin/cut -d \| -f 1 | /bin/grep -qw urutau",
  6. require => Service["postgresql"],
  7. }
  8.  
  9. exec { 'psql create user':
  10. user => "postgres",
  11. command => "/usr/bin/createuser urutau",
  12. path => "/home/pet",
  13. unless => "/usr/bin/psql postgres -tAc \"SELECT 1 FROM pg_roles WHERE rolname='urutau'\" | /bin/grep -q 1",
  14. require => Service["postgresql"],
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement