chef training day5

Download Chef training Day5

If you can't read please download the document

Upload: andriy-samilyak

Post on 16-Apr-2017

7.247 views

Category:

Technology


0 download

TRANSCRIPT

DevOps: Opscode Chef

Day 5

Andriy Samilyak

[email protected]: samilyaka

Goals

Knife plugins

Chef with Windows

Amazon OpsWorks

Final practice LARGE one

Plugins

Custom set of knife commands

Usually in CHEF_REPO/.chef/plugins/knife/

[Maybe] Useful knife plugins

Knife-flip moving nodes in environment

Knife-spork another workflow

Knife-preflight check nodes with cookbook

Knife-ec2 Amazon EC2 management

Knife-sshx easy ssh login

Chef on Windows

/opt/chef/embedded/bin/gem install knife-windows> knife winrm> knife bootstrap windows

http://community.opscode.com/cookbooks/iishttp://community.opscode.com/cookbooks/sql_server

Windows ACL

directory 'C:\mordor' dorights :read, 'MORDOR\Minions'rights :full_control, 'MORDOR\Sauron'

end

Amazon OpsWorks

Final practice - Dokuwiki

Ubuntu official package is toooo old (2012)

We need to install it from sourcehttps://www.dokuwiki.org/installhttp://download.dokuwiki.org/

We'll create new role, new cookbook, new server

Dokuwiki - 1

Download tarball

What resource should we use?

Downloading tarball
cookbooks/dokuwiki/recipes/default.rb

src_file= "http://download.dokuwiki.org/out/dokuwiki-de06047915ab0d0e8c04d093b4e15099.tgz"

tgt_file = "#{Chef::Config[:file_cache_path]}/dokuwiki.tar.gz"

remote_file tgt_file do source src_file mode 0644 action :create_if_missing backup falseend

Dokuwiki - 2

Extract tarball

tar -xf dokuwiki.tar.gz -C /var/www

What resource should we use?

Extracting tarball
cookbooks/dokuwiki/recipes/default.rb

bash "extract_dokuwiki" do code