Skip to content

Instantly share code, notes, and snippets.

@satomacoto
Last active January 1, 2016 04:59
Show Gist options
  • Save satomacoto/8095914 to your computer and use it in GitHub Desktop.
Save satomacoto/8095914 to your computer and use it in GitHub Desktop.
Vagrant and Chef

Vagrant and Chef

Vagrant

$ vagrant init centos64
$ vagrant ssh-config --host harmoney >> ~/.ssh/config
$ vagrant up

sandbox

$ vagrant sandbox on
$ vagrant sandbox rollback
$ vagrant sandbox commit
$ vagrant sandbox off

Chef

$ knife solo init chef-repo
$ cd chef-repo
$ knife solo prepare harmony

$ knife cookbook create hello -o site-cookbooks/
$ vim site-cookbooks/hello/recipes
log "Hello world"

$ vim nodes/harmoney.json
{
    "run_list": [
        "recipe[hello]"
    ]
}

$ knife solo cook harmony

Berkshelf

$ gem i berkshelf --no-ri --no-rdoc
$ vim Berksfile
# 以下の3行を書いて保存
site :opscode
cookbook 'yum'
cookbook 'nginx'

$ berks install --path cookbooks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment