Skip to content

Instantly share code, notes, and snippets.

@house9
Created January 28, 2013 01:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save house9/4652008 to your computer and use it in GitHub Desktop.
Save house9/4652008 to your computer and use it in GitHub Desktop.
Add jenkins user to postgres as super user
execute "usermod jenkins -aG postgres" do
not_if "groups jenkins | grep postgres"
end
execute "createuser jenkins --superuser --no-password" do
user "postgres"
group "postgres"
cwd "/var/lib/postgresql"
not_if "psql postgres -tAc \"SELECT 1 FROM pg_roles WHERE rolname='jenkins'\" | grep 1",
:cwd => "/var/lib/postgresql",
:user => "postgres",
:group => "postgres"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment