Skip to content

Instantly share code, notes, and snippets.

@andyl
Created April 25, 2012 16:06
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 andyl/2490956 to your computer and use it in GitHub Desktop.
Save andyl/2490956 to your computer and use it in GitHub Desktop.
# this Define just ensures that app and configuration
# directories have been created for the deploy user.
#
# production apps are always stored in "/home/<user>/a".
# nginx configuration for the app is stored in "/home/<user>/a/_conf"
# the configuration directory is referenced in nginx.conf
define ngusr($duser = $title) {
sysuser { $duser : }
File { owner => $duser, group => $duser }
file {
"/home/$duser/a" :
ensure => directory;
"/home/$duser/a/_conf" :
ensure => link,
target => '/etc/nginx/conf.d';
}
exec { "install bundler for $duser" :
command => "rbenv rehash && gem install bundler && rbenv rehash",
cwd => "/home/$duser",
group => $duser,
user => $duser,
path => ["/home/$duser/.rbenv-usergems/shims", "/opt/rbenv/bin", "/opt/rbenv/libexec/", "/bin"],
require => Sysuser[$duser],
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment