Last active
August 29, 2015 14:17
-
-
Save hiroharu8864/b47895ba439e1a8ae95b to your computer and use it in GitHub Desktop.
knife-zeroをvagrant環境で利用したメモ
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
$ cd {workgir} | |
$ bundle init | |
$ vim Gemfile | |
source "https://rubygems.org" | |
gem 'chef' | |
gem 'knife-zero' | |
$ vim Vagrantfile | |
Vagrant.configure(2) do |config| | |
config.vm.box = "base_6_5_64" | |
config.vm.define "byakko" do |byakko| | |
byakko.vm.hostname = "byakko" | |
byakko.vm.network :private_network, ip: "192.168.60.101" | |
end | |
end | |
$ knife zero bootstrap 192.168.60.101 -i ./.vagrant/machines/byakko/virtualbox/private_key -N 192.168.60.101 -x vagrant --sudoknife node list | |
$ knife zero bootstrap 192.168.60.101 -i ./.vagrant/machines/byakko/virtualbox/private_key -x vagrant --sudoknife node list | |
-> -Nオプションを付けるとIPアドレスでlist登録される。今回はホスト名で登録するため、-Nオプションは付けない。 | |
$ knife cookbook create nginx -o ./cookbooks/ | |
$ knife node run_list add byakko 'recipe[nginx]' | |
$ knife zero chef_client "name:byakko" -x vagrant -i ./.vagrant/machines/byakko/virtualbox/private_key --sudo -a name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment