Skip to content

Instantly share code, notes, and snippets.

@sevos
Created September 24, 2009 21:54
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 sevos/193079 to your computer and use it in GitHub Desktop.
Save sevos/193079 to your computer and use it in GitHub Desktop.
Example recipe for RoRDevToolkit
installation_unit "postgres",
:description => "Install PostgreSQL server, PGAdmin3 and Ruby&Rails adapters" do |i|
i.install_system_package "postgres"
i.step "First start PostgreSQL server", :supported => :fedora do |s,i|
s.surun "service postgresql initdb"
s.surun "service postgresql start"
end
i.step "Run console to set default postgres password" do |s,i|
s.info "When you see"
s.info "postgres=# prompt type:"
s.info "\e[1;31m\\password\e[33m"
s.info "and then set postgres user password"
s.info "it should be strong password"
s.info "(postgres user has administrative privileges)"
s.info "After that type \e[1;31m\\q\e[33m"
s.surun "su -l postgres -c psql postgres"
end
i.step "Enable local access via username stored in database" do |s,i|
hba_file = s.sufind("pg_hba.conf", ['/etc', '/var']).first
s.info "Patching #{hba_file}"
s.surun "patch -Ns #{hba_file} files/postgres/pg_hba.conf.patch"
s.surun "chown postgres:postgres #{hba_file}"
end
i.step "Restart server" do |s,i|
sfile = s.sufind("*postgre*", ["/etc/init.d/"]).first
s.surun "#{sfile} restart"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment