Created
June 22, 2012 07:14
-
-
Save jwhitley/2970941 to your computer and use it in GitHub Desktop.
Sample VM user-customization Chef recipe
This file contains 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
include_recipe "git" | |
%w{ vim zsh }.each { |p| package p } | |
bash "Set vagrant's shell to zsh" do | |
code <<-EOT | |
chsh -s /bin/zsh vagrant | |
EOT | |
not_if 'test "/bin/zsh" = "$(grep vagrant /etc/passwd | cut -d: -f7)"' | |
end | |
rc_repo = "[email protected]:GITHUB_USERID/YOUR_RCFILE_REPO.git" | |
# This is needed since the check in the git resource is busted; | |
# it looks for the target dir, not <target>/.git | |
bash "Perform initial clone" do | |
code <<-EOT | |
cd /home/vagrant | |
sudo -E -u vagrant bash -c "git init . && git remote add origin #{rc_repo} && git pull origin master" | |
EOT | |
not_if 'test -d /home/vagrant/.git' | |
end | |
git "/home/vagrant" do | |
repository rc_repo | |
reference "master" | |
action :sync | |
user 'vagrant' | |
group 'vagrant' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment