Created
April 25, 2012 16:06
-
-
Save andyl/2490956 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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