Last active
September 27, 2018 20:18
-
-
Save sginkov/ed3fe2cb78fab07dff71 to your computer and use it in GitHub Desktop.
Revisions
-
sginkov renamed this gist
Apr 10, 2016 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
sginkov revised this gist
May 24, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -21,7 +21,7 @@ gem install bundler && bundle install knife solo init . ``` #### 3. Create Berkshelf config if it's not exist ```bash berks init . -
sginkov revised this gist
May 24, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -18,7 +18,7 @@ gem install bundler && bundle install #### 3. Create a new directory structure(i.e. “kitchen”) that fits with Chef's standard structure and can be used to build and store recipes ```bash knife solo init . ``` #### 3. Create Berkshelf config -
sginkov revised this gist
May 24, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # Installation steps to use chef scripts #### 1. Install ruby #### 2. Added Gemfile with kinfe-solo ``` -
sginkov revised this gist
May 24, 2015 . No changes.There are no files selected for viewing
-
sginkov created this gist
May 24, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,106 @@ # Installation steps to use chef scripts #### 1. Install ruby and bundler #### 2. Added Gemfile with kinfe-solo ``` source "https://rubygems.org" gem "knife-solo" gem "berkshelf" ``` #### 3. Install chef solo with dependencies ```bash gem install bundler && bundle install ``` #### 3. Create a new directory structure(i.e. “kitchen”) that fits with Chef's standard structure and can be used to build and store recipes ```bash knife solo init ``` #### 3. Create Berkshelf config ```bash berks init . ``` Script above creates file `Berksfile` which contains cookbook dependencies #### 4. Added cookbook dependencies to Berksfile Example: ``` source "https://supermarket.chef.io" metadata cookbook "mysql" cookbook "nginx", "~> 2.6" ``` #### 5. Install cookbook dependencies ```bash berks install ``` This command downloads required cookbooks and store it into `cookbooks` directory. # Deploy All nodes are located into directory 'nodes'. #### 1. First of all you should install chef-client on taget server ``` knife solo prepare [user]@[node] --forward-agent ``` Example for staging.com: ```bash knife solo prepare root@staging.com --forward-agent ``` #### 2. You should execute the following command to run chef script for you node: ```bash knife solo cook [user]@[node] --forward-agent ``` Example for staging.com: ```bash knife solo cook root@staging.com --forward-agent ``` # Testing chef scripts with vagrant Vagrant helps to create virtual host on your local machine which used for emulating external virtual hosts. ## Installation vagrant steps #### 1. Install virtualbox and vagrant #### 2. Install vagrant plugins ``` vagrant plugin install vagrant-hostsupdater ``` #### 3. Add dummy box from https://atlas.hashicorp.com/boxes/search ``` vagrant box add precise32 http://files.vagrantup.com/precise32.box vagrant box add ubuntu-14.04 https://oss-binaries.phusionpassenger.com/vagrant/boxes/latest/ubuntu-14.04-amd64-vbox.box ``` #### 4. Start vagrant This command create local virtual hosts which described into Vagrantfile. ``` vagrant up ```