SlideShare a Scribd company logo
Linecook
(A Chef Alternative)
      Simon Chiang
Chef
Ruby
       Chef
Opscode
Ruby
       Chef
“Systems Integration
    Framework”         Opscode
      Ruby
                   Chef
“Systems Integration
    Framework”         Opscode
      Ruby

   Open Source     Chef
“Systems Integration
    Framework”         Opscode
      Ruby

   Open Source     Chef
  Automated
“Systems Integration
    Framework”         Opscode
      Ruby

   Open Source     Chef
                             Scalable
  Automated
“Systems Integration
    Framework”         Opscode
      Ruby
                          Server Provisioning
   Open Source     Chef
                             Scalable
  Automated
“Systems Integration
    Framework”            Opscode
      Ruby
                             Server Provisioning
   Open Source     Chef
                                Scalable
  Automated

              Community
“Systems Integration
    Framework”            Opscode
      Ruby
                             Server Provisioning
   Open Source     Chef
                                Scalable
  Automated

              Community
                                Hotness
An alternative to
  shell scripts
Never a quick
         Quickstart
“Before installing Chef, you should take a moment to
understand the various "flavors" of chef: client-server,
chef-solo, and the Opscode Platform. Deciding which
one is right for you will impact your installation
process. You may also want to take a quick look at
Chef's architecture to get an idea of what you're
installing before you proceed.”


          http://wiki.opscode.com/display/chef/Installation
Not a script,
                     but sort of...
[lib/chef/provider/package/zypper.rb] @ 0.10.0.rc.0

def install_package(name, version)
  if version
    run_command(
      :command => "zypper -n --no-gpg-checks install -l   #{name}=#{version}"
    )
Not a script,
                     but sort of...
[lib/chef/provider/package/zypper.rb] @ 0.10.0.rc.0

def install_package(name, version)
  if version
    run_command(
      :command => "zypper -n --no-gpg-checks install -l   #{name}=#{version}"
    )




                           Fixed options :(
Not a script,
                     but sort of...
[lib/chef/provider/package/zypper.rb] @ 0.10.0.rc.0

def install_package(name, version)
  if version
    run_command(
      :command => "zypper -n --no-gpg-checks install -l        #{name}=#{version}"
    )




                           Fixed options :(


                                                          Error for version=""
                                              https://github.com/opscode/chef/pull/27
Many moving parts




    http://wiki.opscode.com/display/chef/Architecture
Many moving parts




http://wiki.opscode.com/display/chef/Vagrant




                                               http://wiki.opscode.com/display/chef/Architecture
Many moving parts




http://wiki.opscode.com/display/chef/Vagrant




                                                                                                   http://community.opscode.com/cookbooks


                                               http://wiki.opscode.com/display/chef/Architecture
Alternative?
Shell Scripts!
Linecook
A Shell Script Generator
Established Tools
(bash, ssh, gems, VirtualBox)
Start with a Script
 End with a Script
Pretty quick
       Quickstart

Make a server

Make a script

Run script on server
Pretty quick
       Quickstart

Make a server          1
Make a script

Run script on server
Pretty quick
       Quickstart

Make a server          1
Make a script

Run script on server   2
Pretty quick
       Quickstart

Make a server          1
Make a script          3
Run script on server   2
An ERB Trick...
How to Make a Server


VirtualBox

Install OS

SSH Key Exchange   localhost
How to Make a Server


VirtualBox         VirtualBox
Install OS

SSH Key Exchange   localhost
How to Make a Server

                   abox-ubuntu

VirtualBox         VirtualBox
Install OS

SSH Key Exchange    localhost
How to Make a Server

                   abox-ubuntu

VirtualBox         VirtualBox
Install OS

SSH Key Exchange    localhost
Port Forwarding

                                   abox-ubuntu
VBoxManage modifyvm abox
  --natpf1 'abox-ssh,tcp,,
         2220,,22'                 VirtualBox

 Access VM by ssh to
 localhost
                                    localhost

                             ssh -p 2220 linecook@localhost
Lather, rinse

                                   abox-ubuntu
VBoxManage modifyvm bbox
  --natpf1 'bbox-ssh,tcp,,        bbox-ubuntu
         2221,,22'                        ...

 Repeat as needed
                                    localhost
                             ssh -p 2221 linecook@localhost
                             ssh -p 2220 linecook@localhost
Advantages

No special prerequisites on servers

Fast Access (fast enough for TDD)

Cmdline control

Multiple VMs

Snapshots
How to Run Scripts
cat > script.sh <<"DOC"
echo "# $(whoami)@$(hostname): hello
world!"
DOC
chmod +x script.sh

scp -P 2220 script.sh linecook@localhost:/tmp/script.sh
ssh -p 2220 linecook@localhost -- /tmp/script.sh
# linecook@abox-ubuntu: hello world!
Redundany
cat > script.sh <<"DOC"
echo "# $(whoami)@$(hostname): hello
world!"
DOC
chmod +x script.sh

scp -P 2220 script.sh linecook@localhost:/tmp/script.sh
ssh -p 2220 linecook@localhost -- /tmp/script.sh
# linecook@abox-ubuntu: hello world!
Use SSH Config
mkdir config
cat > config/ssh <<"DOC"
Host abox
Port 2220
User linecook
Hostname localhost
DOC

scp -F config/ssh script.sh abox:/tmp/script.sh
ssh -F config/ssh abox -- /tmp/script.sh
# linecook@abox-ubuntu: hello world!
Multiple Hosts
cat > config/ssh <<"DOC"
Host abox
Port 2220

Host bbox
Port 2221

Host *
User linecook
Hostname localhost
DOC

scp -F config/ssh script.sh bbox:/tmp/script.sh
ssh -F config/ssh bbox -- /tmp/script.sh
# linecook@bbox-ubuntu: hello world!
Redundancy
cat > config/ssh <<"DOC"
Host abox
Port 2220

Host bbox
Port 2221

Host *
User linecook
Hostname localhost
DOC

scp -F config/ssh script.sh bbox:/tmp/script.sh
ssh -F config/ssh bbox -- /tmp/script.sh
# linecook@bbox-ubuntu: hello world!
Redundancy
cat > config/ssh <<"DOC"
Host abox
Port 2220

Host bbox
Port 2221

Host *
User linecook
Hostname localhost
DOC

scp -F config/ssh script.sh bbox:/tmp/script.sh
ssh -F config/ssh bbox -- /tmp/script.sh
# linecook@bbox-ubuntu: hello world!
Make a “Package”
     Run with Linecook
[config/ssh]             [packages/abox/script.sh]
Host abox               echo "# $(whoami)@$(hostname): hello
Port 2220               world!"
                        [packages/bbox/script.sh]
Host bbox
                        echo "# $(whoami)@$(hostname): Hullo
Port 2221
                        Wurld!"
Host *
User linecook
Hostname localhost

   linecook run --script script.sh --remote-dir /tmp abox bbox
   # linecook@abox-ubuntu: hello world!
   # linecook@bbox-ubuntu: Hullo Wurld!
Leverge Defaults

[config/ssh]            [packages/abox/run]
Host abox              echo "# $(whoami)@$(hostname): hello
Port 2220              world!"
                      [packages/bbox/run]
Host bbox
                      echo "# $(whoami)@$(hostname): Hullo
Port 2221
                      Wurld!"
Host *
User linecook                     script: run
Hostname localhost                remote dir: ~/linecook
                                  hosts: *
   linecook run
   # linecook@abox-ubuntu: hello world!
   # linecook@bbox-ubuntu: Hullo Wurld!
Easy Way To Test!
[packages/abox/run]
echo "hello world" > /tmp/message.txt


[packages/abox/test]
if [ $(cat /tmp/message.txt) == "hello world" ]
then echo "# success"
else echo "# fail"
fi


linecook run --script test
# fail
linecook run
linecook run --script test
# success
Cmdline Dev Cycle

linecook   start
linecook   run
linecook   run --script test
linecook   ssh abox
linecook   snapshot modified
linecook   stop

linecook start --snapshot modified
...
Advantages

Standard use of SSH

One standard config file

Ordinary inputs (directories, scripts)

Multiple VMs

Flexible!
How to Make a Script
How to Make a Script
      (boring alert)
Start with a Script

[packages/abox/run]
echo "# I will not manually configure my server"



linecook run
# I will not manually configure my server
Convert to Recipe
[packages/abox.yml]
linecook:
   package:
     recipes:
                               A package file
       run: abox

[recipes/abox.rb]
target <<"SCRIPT"
echo "# I will not manually configure my server"
SCRIPT
Convert to Recipe
[packages/abox.yml]
linecook:
   package:                       A tempfile
     recipes:                (packages/abox/run)
       run: abox

[recipes/abox.rb]
target <<"SCRIPT"
echo "# I will not manually configure my server"
SCRIPT
Simplify
[packages/abox.yml]            If default, no
{}
                              manifest needed
[recipes/abox.rb]
target <<"SCRIPT"
echo "# I will not manually configure my server"
SCRIPT
Build and Run
[packages/abox.yml]
{}



[recipes/abox.rb]
target <<"SCRIPT"
echo "# I will not manually configure my server"
SCRIPT


linecook build
linecook run
# I will not manually configure my server
Ok... that was boring.
Use Recipe as
Context for ERB
ERB Compiles to Ruby

require 'erb'

compiler = ERB::Compiler.new("<>")
compiler.put_cmd = "target<<"
compiler.insert_cmd = "target<<"
compiler.compile "got <%= obj %>"

# => "target<<"got "; target<<(( obj ).to_s)"
InstanceEval for Context
 class Recipe
   attr_accessor :target
   def initialize
     @target = ""
   end
   def obj
     "milk"
   end
 end

 code = "target<<"got "; target<<(( obj ).to_s)"

 recipe = Recipe.new
 recipe.instance_eval(code)
 recipe.target

 # => "got milk"
Make a Module
module Helper
  def get(obj)
    target<<"got "; target<<(( obj ).to_s)
  end
end

recipe = Recipe.new
recipe.extend Helper
recipe.instance_eval %q{
  get "milk"
  target << ", "
  get "cookies"
}
recipe.target

# => "got milk, got cookies"
Make a Module
module Helper
  def get(obj)
    target<<"got "; target<<(( obj ).to_s)
  end
end

recipe = Recipe.new
recipe.extend Helper
recipe.instance_eval %q{
  get "milk"
  target << ", "
  get "cookies"
                               This is a recipe!
}
recipe.target

# => "got milk, got cookies"
Helpers
[helpers/example/echo.erb]
Write an echo statement
(str)
--
echo "<%= str %>"


[recipes/abox.rb]
helpers "example"
echo "# I will not manually configure my server"
Helpers
[helpers/example/echo.erb]       [lib/example.rb]
Write an echo statement          module Example
(str)                                # Write an echo ...
--                                   def echo(str)
echo "<%= str %>"                      target<< "echo ";...
                                     end
                                 end
[recipes/abox.rb]
helpers "example"
echo "# I will not manually configure my server"
Helpers
[helpers/example/echo.erb]       [lib/example.rb]
Write an echo statement          module Example
(str)                                # Write an echo ...
--                                   def echo(str)
echo "<%= str %>"                      target<< "echo ";...
                                     end
                                 end
[recipes/abox.rb]
helpers "example"
echo "# I will not manually configure my server"
Helpers
[helpers/example/echo.erb]       [lib/example.rb]
Write an echo statement          module Example
(str)                                # Write an echo ...
--                                   def echo(str)
echo "<%= str %>"                      target<< "echo ";...
                                     end
                                 end
[recipes/abox.rb]
helpers "example"
echo "# I will not manually configure my server"
Helpers
[helpers/example/echo.erb]       [lib/example.rb]
Write an echo statement          module Example
(str)                                # Write an echo ...
--                                   def echo(str)
echo "<%= str %>"                      target<< "echo ";...
                                     end
                                 end
[recipes/abox.rb]
helpers "example"
echo "# I will not manually configure my server"
Helpers
[helpers/example/echo.erb]       [lib/example.rb]
Write an echo statement          module Example
(str)                                # Write an echo ...
--                                   def echo(str)
echo "<%= str %>"                      target<< "echo ";...
                                     end
                                 end
[recipes/abox.rb]
helpers "example"
echo "# I will not manually configure my server"
Helpers
[helpers/example/echo.erb]       [lib/example.rb]
Write an echo statement          module Example
(str)                                # Write an echo ...
--                                   def echo(str)
echo "<%= str %>"                      target<< "echo ";...
                                     end
                                 end
[recipes/abox.rb]
helpers "example"
echo "# I will not manually configure my server"
Helpers
[helpers/example/echo.erb]
Write an echo statement
(str)
--                               require "example"
echo "<%= str %>"                extend Example


[recipes/abox.rb]
helpers "example"
echo "# I will not manually configure my server"
Helpers
[helpers/example/echo.erb]
Write an echo statement
(str)
--
echo "<%= str %>"


[recipes/abox.rb]
helpers "example"
echo "# I will not manually configure my server"



linecook build
linecook run
# I will not manually configure my server
Capture (no write)
[helpers/example/color.erb]
Add color to a string
(color, str)
   codes = Hash[*%W{red 0;31 white 1;37 blue 0;34}]
--
033[<%= codes[color.to_s] %>m<%= str %>033[0m

[recipes/abox.rb]
helpers "example"
msg = "# I will not manually configure my server"
echo _color("blue", msg)
Capture (no write)
[helpers/example/color.erb]
Add color to a string
(color, str)
   codes = Hash[*%W{red 0;31 white 1;37 blue 0;34}]
--
033[<%= codes[color.to_s] %>m<%= str %>033[0m

[recipes/abox.rb]
helpers "example"
msg = "# I will not manually configure my server"
echo _color("blue", msg)



    Prefix with underscore
  String output used as input
Capture (no write)
[helpers/example/color.erb]
Add color to a string
(color, str)
   codes = Hash[*%W{red 0;31 white 1;37 blue 0;34}]
--
033[<%= codes[color.to_s] %>m<%= str %>033[0m

[recipes/abox.rb]
helpers "example"
msg = "# I will not manually configure my server"
echo _color("blue", msg)

linecook build
linecook run
# I will not manually configure my server
Recipes are Ruby
[recipes/abox.rb]
helpers "example"

msg = "# I will not manually configure my server"
3.times do
  echo _color("blue", msg)
end

linecook   build
linecook   run
# I will   not manually configure my server
# I will   not manually configure my server
# I will   not manually configure my server
Advantages
Easily extensible DSL

Produces ordinary modules

  Test as any other Ruby

  Distribute as Gems (versions, bundler)

Reprocessing of output

Also, kind of cool...
Linebook
(Standard Library for Linecook)
Logic + Pipelines
[recipes/demo.rb]
helpers 'linebook/shell'

unless_ _file?('/tmp/message') do
  cat.to('/tmp/message').heredoc do
    writeln 'hello world!'
  end
end

cat('/tmp/message')
Logic + Pipelines
[packages/demo/run]

if ! [ -f "/tmp/message" ]
then
   cat > /tmp/message << HEREDOC_0
hello world!
HEREDOC_0
fi

cat "/tmp/message"
Under Construction

Exit status checks, ‘stack trace’

Helpers for login/su

User and File Management

Server-side testing (assert_script)

Installs, config, deployments, etc.
No need to wait!
Linecook

Attributes
Helpers
             Recipes    Packages
Files
Templates
                        Server
Learn More
GitHub:

  pinnacol/linecook.git

  pinnacol/linebook.git

Me:

  github.com/thinkerbot

  @thinkerbot
Thanks Pinnacol!
Thanks Derailed!
Questions?

More Related Content

What's hot

Automation with ansible
Automation with ansibleAutomation with ansible
Automation with ansible
Khizer Naeem
 
A quick intro to Ansible
A quick intro to AnsibleA quick intro to Ansible
A quick intro to Ansible
Dan Vaida
 
Infrastructure = Code
Infrastructure = CodeInfrastructure = Code
Infrastructure = Code
Georg Sorst
 
DevOps Hackathon - Session 1: Vagrant
DevOps Hackathon - Session 1: VagrantDevOps Hackathon - Session 1: Vagrant
DevOps Hackathon - Session 1: Vagrant
Antons Kranga
 
Automation and Ansible
Automation and AnsibleAutomation and Ansible
Automation and Ansible
jtyr
 
Ansible, best practices
Ansible, best practicesAnsible, best practices
Ansible, best practices
Bas Meijer
 
Ansible Automation to Rule Them All
Ansible Automation to Rule Them AllAnsible Automation to Rule Them All
Ansible Automation to Rule Them All
Tim Fairweather
 
Ansible - Swiss Army Knife Orchestration
Ansible - Swiss Army Knife OrchestrationAnsible - Swiss Army Knife Orchestration
Ansible - Swiss Army Knife Orchestration
bcoca
 
DevOpsDaysCPT Ansible Infrastrucutre as Code 2017
DevOpsDaysCPT Ansible Infrastrucutre as Code 2017DevOpsDaysCPT Ansible Infrastrucutre as Code 2017
DevOpsDaysCPT Ansible Infrastrucutre as Code 2017
Jumping Bean
 
Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for Developers
Antons Kranga
 
infra-as-code
infra-as-codeinfra-as-code
infra-as-code
Itamar Hassin
 
Testing your-automation-code (vagrant version) v0.2
Testing your-automation-code (vagrant version) v0.2Testing your-automation-code (vagrant version) v0.2
Testing your-automation-code (vagrant version) v0.2
Sylvain Tissot
 
Ansible - Introduction
Ansible - IntroductionAnsible - Introduction
Ansible - Introduction
Stephane Manciot
 
#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible
Cédric Delgehier
 
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Puppet
 
Jenkins and ansible reference
Jenkins and ansible referenceJenkins and ansible reference
Jenkins and ansible reference
laonap166
 
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Idan Tohami
 
Ansible intro
Ansible introAnsible intro
Ansible is the simplest way to automate. SymfonyCafe, 2015
Ansible is the simplest way to automate. SymfonyCafe, 2015Ansible is the simplest way to automate. SymfonyCafe, 2015
Ansible is the simplest way to automate. SymfonyCafe, 2015
Alex S
 
DevOps hackathon Session 2: Basics of Chef
DevOps hackathon Session 2: Basics of ChefDevOps hackathon Session 2: Basics of Chef
DevOps hackathon Session 2: Basics of Chef
Antons Kranga
 

What's hot (20)

Automation with ansible
Automation with ansibleAutomation with ansible
Automation with ansible
 
A quick intro to Ansible
A quick intro to AnsibleA quick intro to Ansible
A quick intro to Ansible
 
Infrastructure = Code
Infrastructure = CodeInfrastructure = Code
Infrastructure = Code
 
DevOps Hackathon - Session 1: Vagrant
DevOps Hackathon - Session 1: VagrantDevOps Hackathon - Session 1: Vagrant
DevOps Hackathon - Session 1: Vagrant
 
Automation and Ansible
Automation and AnsibleAutomation and Ansible
Automation and Ansible
 
Ansible, best practices
Ansible, best practicesAnsible, best practices
Ansible, best practices
 
Ansible Automation to Rule Them All
Ansible Automation to Rule Them AllAnsible Automation to Rule Them All
Ansible Automation to Rule Them All
 
Ansible - Swiss Army Knife Orchestration
Ansible - Swiss Army Knife OrchestrationAnsible - Swiss Army Knife Orchestration
Ansible - Swiss Army Knife Orchestration
 
DevOpsDaysCPT Ansible Infrastrucutre as Code 2017
DevOpsDaysCPT Ansible Infrastrucutre as Code 2017DevOpsDaysCPT Ansible Infrastrucutre as Code 2017
DevOpsDaysCPT Ansible Infrastrucutre as Code 2017
 
Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for Developers
 
infra-as-code
infra-as-codeinfra-as-code
infra-as-code
 
Testing your-automation-code (vagrant version) v0.2
Testing your-automation-code (vagrant version) v0.2Testing your-automation-code (vagrant version) v0.2
Testing your-automation-code (vagrant version) v0.2
 
Ansible - Introduction
Ansible - IntroductionAnsible - Introduction
Ansible - Introduction
 
#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible
 
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
 
Jenkins and ansible reference
Jenkins and ansible referenceJenkins and ansible reference
Jenkins and ansible reference
 
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
 
Ansible intro
Ansible introAnsible intro
Ansible intro
 
Ansible is the simplest way to automate. SymfonyCafe, 2015
Ansible is the simplest way to automate. SymfonyCafe, 2015Ansible is the simplest way to automate. SymfonyCafe, 2015
Ansible is the simplest way to automate. SymfonyCafe, 2015
 
DevOps hackathon Session 2: Basics of Chef
DevOps hackathon Session 2: Basics of ChefDevOps hackathon Session 2: Basics of Chef
DevOps hackathon Session 2: Basics of Chef
 

Viewers also liked

Arkansas History Through Music part _2__6-16-10
Arkansas History Through Music part _2__6-16-10Arkansas History Through Music part _2__6-16-10
Arkansas History Through Music part _2__6-16-10
John Jarboe
 
Arkansas History Through Music part _3__ 6-16-10
Arkansas History Through Music  part _3__ 6-16-10Arkansas History Through Music  part _3__ 6-16-10
Arkansas History Through Music part _3__ 6-16-10
John Jarboe
 
Ar hist _4__6-17-10
Ar hist _4__6-17-10Ar hist _4__6-17-10
Ar hist _4__6-17-10
John Jarboe
 
Python(21.04)
Python(21.04) Python(21.04)
Python(21.04) Sardnej
 
IT Market Report Q1 2011 (Cp Retail)
IT Market Report Q1 2011 (Cp Retail)IT Market Report Q1 2011 (Cp Retail)
IT Market Report Q1 2011 (Cp Retail)
suzannepriddle
 
High Point Networks Company Overview
High Point Networks Company OverviewHigh Point Networks Company Overview
High Point Networks Company Overview
jfetsch
 
Python(21.04) Networking applications.  Fork,  asynchronous applications.
Python(21.04) Networking applications.  Fork,  asynchronous applications.Python(21.04) Networking applications.  Fork,  asynchronous applications.
Python(21.04) Networking applications.  Fork,  asynchronous applications.Sardnej
 
Dr. Ramanand Jadhav_CV
Dr. Ramanand Jadhav_CVDr. Ramanand Jadhav_CV
Dr. Ramanand Jadhav_CV
Dr. RAMANAND JADHAV
 
Ram cv
Ram cvRam cv
Plymovent business unit ETS IAQ
Plymovent business unit ETS IAQPlymovent business unit ETS IAQ
Plymovent business unit ETS IAQ
Plymovent
 
It’s my party!
It’s my party!It’s my party!
It’s my party!
landers_k
 
Arkansas History Through Music part _one__6-15-10__
Arkansas History Through Music   part _one__6-15-10__Arkansas History Through Music   part _one__6-15-10__
Arkansas History Through Music part _one__6-15-10__
John Jarboe
 
Ram cv
Ram cvRam cv
Slide show
Slide showSlide show
Slide show
landers_k
 
Eczema home remedies
Eczema home remediesEczema home remedies
Eczema home remedies
Dax Cheng
 

Viewers also liked (15)

Arkansas History Through Music part _2__6-16-10
Arkansas History Through Music part _2__6-16-10Arkansas History Through Music part _2__6-16-10
Arkansas History Through Music part _2__6-16-10
 
Arkansas History Through Music part _3__ 6-16-10
Arkansas History Through Music  part _3__ 6-16-10Arkansas History Through Music  part _3__ 6-16-10
Arkansas History Through Music part _3__ 6-16-10
 
Ar hist _4__6-17-10
Ar hist _4__6-17-10Ar hist _4__6-17-10
Ar hist _4__6-17-10
 
Python(21.04)
Python(21.04) Python(21.04)
Python(21.04)
 
IT Market Report Q1 2011 (Cp Retail)
IT Market Report Q1 2011 (Cp Retail)IT Market Report Q1 2011 (Cp Retail)
IT Market Report Q1 2011 (Cp Retail)
 
High Point Networks Company Overview
High Point Networks Company OverviewHigh Point Networks Company Overview
High Point Networks Company Overview
 
Python(21.04) Networking applications.  Fork,  asynchronous applications.
Python(21.04) Networking applications.  Fork,  asynchronous applications.Python(21.04) Networking applications.  Fork,  asynchronous applications.
Python(21.04) Networking applications.  Fork,  asynchronous applications.
 
Dr. Ramanand Jadhav_CV
Dr. Ramanand Jadhav_CVDr. Ramanand Jadhav_CV
Dr. Ramanand Jadhav_CV
 
Ram cv
Ram cvRam cv
Ram cv
 
Plymovent business unit ETS IAQ
Plymovent business unit ETS IAQPlymovent business unit ETS IAQ
Plymovent business unit ETS IAQ
 
It’s my party!
It’s my party!It’s my party!
It’s my party!
 
Arkansas History Through Music part _one__6-15-10__
Arkansas History Through Music   part _one__6-15-10__Arkansas History Through Music   part _one__6-15-10__
Arkansas History Through Music part _one__6-15-10__
 
Ram cv
Ram cvRam cv
Ram cv
 
Slide show
Slide showSlide show
Slide show
 
Eczema home remedies
Eczema home remediesEczema home remedies
Eczema home remedies
 

Similar to Linecook - A Chef Alternative

Cloud Automation with Opscode Chef
Cloud Automation with Opscode ChefCloud Automation with Opscode Chef
Cloud Automation with Opscode Chef
Sri Ram
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer Toolbox
Pablo Godel
 
Introduction to chef framework
Introduction to chef frameworkIntroduction to chef framework
Introduction to chef framework
morgoth
 
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, OrchestrationThe Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
Erica Windisch
 
Chef or how to make computers do the work for us
Chef or how to make computers do the work for usChef or how to make computers do the work for us
Chef or how to make computers do the work for us
sickill
 
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGHDeploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Erica Windisch
 
Lumen
LumenLumen
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello Production
Joe Ferguson
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
biicode
 
Using rbenv in Production
Using rbenv in ProductionUsing rbenv in Production
Using rbenv in Production
Nic Benders
 
Deploying OpenStack with Chef
Deploying OpenStack with ChefDeploying OpenStack with Chef
Deploying OpenStack with Chef
Matt Ray
 
Docker for developers on mac and windows
Docker for developers on mac and windowsDocker for developers on mac and windows
Docker for developers on mac and windows
Docker, Inc.
 
Preparation study of_docker - (MOSG)
Preparation study of_docker  - (MOSG)Preparation study of_docker  - (MOSG)
Preparation study of_docker - (MOSG)
Soshi Nemoto
 
Practical introduction to dev ops with chef
Practical introduction to dev ops with chefPractical introduction to dev ops with chef
Practical introduction to dev ops with chef
LeanDog
 
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...
Willian Molinari
 
Phoenix Servers with Docker and Nginx
Phoenix Servers with Docker and NginxPhoenix Servers with Docker and Nginx
Phoenix Servers with Docker and Nginx
Nils De Moor
 
Compliance as Code: Velocity with Security - Fraser Pollock, Chef
Compliance as Code: Velocity with Security - Fraser Pollock, ChefCompliance as Code: Velocity with Security - Fraser Pollock, Chef
Compliance as Code: Velocity with Security - Fraser Pollock, Chef
Alert Logic
 
Bare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and ChefBare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and Chef
Matt Ray
 
Chef introduction
Chef introductionChef introduction
Chef introduction
FENG Zhichao
 
Testable Infrastructure with Chef, Test Kitchen, and Docker
Testable Infrastructure with Chef, Test Kitchen, and DockerTestable Infrastructure with Chef, Test Kitchen, and Docker
Testable Infrastructure with Chef, Test Kitchen, and Docker
Mandi Walls
 

Similar to Linecook - A Chef Alternative (20)

Cloud Automation with Opscode Chef
Cloud Automation with Opscode ChefCloud Automation with Opscode Chef
Cloud Automation with Opscode Chef
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer Toolbox
 
Introduction to chef framework
Introduction to chef frameworkIntroduction to chef framework
Introduction to chef framework
 
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, OrchestrationThe Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
 
Chef or how to make computers do the work for us
Chef or how to make computers do the work for usChef or how to make computers do the work for us
Chef or how to make computers do the work for us
 
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGHDeploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
 
Lumen
LumenLumen
Lumen
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello Production
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
Using rbenv in Production
Using rbenv in ProductionUsing rbenv in Production
Using rbenv in Production
 
Deploying OpenStack with Chef
Deploying OpenStack with ChefDeploying OpenStack with Chef
Deploying OpenStack with Chef
 
Docker for developers on mac and windows
Docker for developers on mac and windowsDocker for developers on mac and windows
Docker for developers on mac and windows
 
Preparation study of_docker - (MOSG)
Preparation study of_docker  - (MOSG)Preparation study of_docker  - (MOSG)
Preparation study of_docker - (MOSG)
 
Practical introduction to dev ops with chef
Practical introduction to dev ops with chefPractical introduction to dev ops with chef
Practical introduction to dev ops with chef
 
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...
 
Phoenix Servers with Docker and Nginx
Phoenix Servers with Docker and NginxPhoenix Servers with Docker and Nginx
Phoenix Servers with Docker and Nginx
 
Compliance as Code: Velocity with Security - Fraser Pollock, Chef
Compliance as Code: Velocity with Security - Fraser Pollock, ChefCompliance as Code: Velocity with Security - Fraser Pollock, Chef
Compliance as Code: Velocity with Security - Fraser Pollock, Chef
 
Bare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and ChefBare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and Chef
 
Chef introduction
Chef introductionChef introduction
Chef introduction
 
Testable Infrastructure with Chef, Test Kitchen, and Docker
Testable Infrastructure with Chef, Test Kitchen, and DockerTestable Infrastructure with Chef, Test Kitchen, and Docker
Testable Infrastructure with Chef, Test Kitchen, and Docker
 

Recently uploaded

Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 

Recently uploaded (20)

Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 

Linecook - A Chef Alternative

  • 3. Ruby Chef
  • 5. “Systems Integration Framework” Opscode Ruby Chef
  • 6. “Systems Integration Framework” Opscode Ruby Open Source Chef
  • 7. “Systems Integration Framework” Opscode Ruby Open Source Chef Automated
  • 8. “Systems Integration Framework” Opscode Ruby Open Source Chef Scalable Automated
  • 9. “Systems Integration Framework” Opscode Ruby Server Provisioning Open Source Chef Scalable Automated
  • 10. “Systems Integration Framework” Opscode Ruby Server Provisioning Open Source Chef Scalable Automated Community
  • 11. “Systems Integration Framework” Opscode Ruby Server Provisioning Open Source Chef Scalable Automated Community Hotness
  • 12. An alternative to shell scripts
  • 13. Never a quick Quickstart “Before installing Chef, you should take a moment to understand the various "flavors" of chef: client-server, chef-solo, and the Opscode Platform. Deciding which one is right for you will impact your installation process. You may also want to take a quick look at Chef's architecture to get an idea of what you're installing before you proceed.” http://wiki.opscode.com/display/chef/Installation
  • 14. Not a script, but sort of... [lib/chef/provider/package/zypper.rb] @ 0.10.0.rc.0 def install_package(name, version) if version run_command( :command => "zypper -n --no-gpg-checks install -l #{name}=#{version}" )
  • 15. Not a script, but sort of... [lib/chef/provider/package/zypper.rb] @ 0.10.0.rc.0 def install_package(name, version) if version run_command( :command => "zypper -n --no-gpg-checks install -l #{name}=#{version}" ) Fixed options :(
  • 16. Not a script, but sort of... [lib/chef/provider/package/zypper.rb] @ 0.10.0.rc.0 def install_package(name, version) if version run_command( :command => "zypper -n --no-gpg-checks install -l #{name}=#{version}" ) Fixed options :( Error for version="" https://github.com/opscode/chef/pull/27
  • 17. Many moving parts http://wiki.opscode.com/display/chef/Architecture
  • 18. Many moving parts http://wiki.opscode.com/display/chef/Vagrant http://wiki.opscode.com/display/chef/Architecture
  • 19. Many moving parts http://wiki.opscode.com/display/chef/Vagrant http://community.opscode.com/cookbooks http://wiki.opscode.com/display/chef/Architecture
  • 23. Established Tools (bash, ssh, gems, VirtualBox)
  • 24. Start with a Script End with a Script
  • 25. Pretty quick Quickstart Make a server Make a script Run script on server
  • 26. Pretty quick Quickstart Make a server 1 Make a script Run script on server
  • 27. Pretty quick Quickstart Make a server 1 Make a script Run script on server 2
  • 28. Pretty quick Quickstart Make a server 1 Make a script 3 Run script on server 2
  • 30. How to Make a Server VirtualBox Install OS SSH Key Exchange localhost
  • 31. How to Make a Server VirtualBox VirtualBox Install OS SSH Key Exchange localhost
  • 32. How to Make a Server abox-ubuntu VirtualBox VirtualBox Install OS SSH Key Exchange localhost
  • 33. How to Make a Server abox-ubuntu VirtualBox VirtualBox Install OS SSH Key Exchange localhost
  • 34. Port Forwarding abox-ubuntu VBoxManage modifyvm abox --natpf1 'abox-ssh,tcp,, 2220,,22' VirtualBox Access VM by ssh to localhost localhost ssh -p 2220 linecook@localhost
  • 35. Lather, rinse abox-ubuntu VBoxManage modifyvm bbox --natpf1 'bbox-ssh,tcp,, bbox-ubuntu 2221,,22' ... Repeat as needed localhost ssh -p 2221 linecook@localhost ssh -p 2220 linecook@localhost
  • 36. Advantages No special prerequisites on servers Fast Access (fast enough for TDD) Cmdline control Multiple VMs Snapshots
  • 37. How to Run Scripts cat > script.sh <<"DOC" echo "# $(whoami)@$(hostname): hello world!" DOC chmod +x script.sh scp -P 2220 script.sh linecook@localhost:/tmp/script.sh ssh -p 2220 linecook@localhost -- /tmp/script.sh # linecook@abox-ubuntu: hello world!
  • 38. Redundany cat > script.sh <<"DOC" echo "# $(whoami)@$(hostname): hello world!" DOC chmod +x script.sh scp -P 2220 script.sh linecook@localhost:/tmp/script.sh ssh -p 2220 linecook@localhost -- /tmp/script.sh # linecook@abox-ubuntu: hello world!
  • 39. Use SSH Config mkdir config cat > config/ssh <<"DOC" Host abox Port 2220 User linecook Hostname localhost DOC scp -F config/ssh script.sh abox:/tmp/script.sh ssh -F config/ssh abox -- /tmp/script.sh # linecook@abox-ubuntu: hello world!
  • 40. Multiple Hosts cat > config/ssh <<"DOC" Host abox Port 2220 Host bbox Port 2221 Host * User linecook Hostname localhost DOC scp -F config/ssh script.sh bbox:/tmp/script.sh ssh -F config/ssh bbox -- /tmp/script.sh # linecook@bbox-ubuntu: hello world!
  • 41. Redundancy cat > config/ssh <<"DOC" Host abox Port 2220 Host bbox Port 2221 Host * User linecook Hostname localhost DOC scp -F config/ssh script.sh bbox:/tmp/script.sh ssh -F config/ssh bbox -- /tmp/script.sh # linecook@bbox-ubuntu: hello world!
  • 42. Redundancy cat > config/ssh <<"DOC" Host abox Port 2220 Host bbox Port 2221 Host * User linecook Hostname localhost DOC scp -F config/ssh script.sh bbox:/tmp/script.sh ssh -F config/ssh bbox -- /tmp/script.sh # linecook@bbox-ubuntu: hello world!
  • 43. Make a “Package” Run with Linecook [config/ssh] [packages/abox/script.sh] Host abox echo "# $(whoami)@$(hostname): hello Port 2220 world!" [packages/bbox/script.sh] Host bbox echo "# $(whoami)@$(hostname): Hullo Port 2221 Wurld!" Host * User linecook Hostname localhost linecook run --script script.sh --remote-dir /tmp abox bbox # linecook@abox-ubuntu: hello world! # linecook@bbox-ubuntu: Hullo Wurld!
  • 44. Leverge Defaults [config/ssh] [packages/abox/run] Host abox echo "# $(whoami)@$(hostname): hello Port 2220 world!" [packages/bbox/run] Host bbox echo "# $(whoami)@$(hostname): Hullo Port 2221 Wurld!" Host * User linecook script: run Hostname localhost remote dir: ~/linecook hosts: * linecook run # linecook@abox-ubuntu: hello world! # linecook@bbox-ubuntu: Hullo Wurld!
  • 45. Easy Way To Test! [packages/abox/run] echo "hello world" > /tmp/message.txt [packages/abox/test] if [ $(cat /tmp/message.txt) == "hello world" ] then echo "# success" else echo "# fail" fi linecook run --script test # fail linecook run linecook run --script test # success
  • 46. Cmdline Dev Cycle linecook start linecook run linecook run --script test linecook ssh abox linecook snapshot modified linecook stop linecook start --snapshot modified ...
  • 47. Advantages Standard use of SSH One standard config file Ordinary inputs (directories, scripts) Multiple VMs Flexible!
  • 48. How to Make a Script
  • 49. How to Make a Script (boring alert)
  • 50. Start with a Script [packages/abox/run] echo "# I will not manually configure my server" linecook run # I will not manually configure my server
  • 51. Convert to Recipe [packages/abox.yml] linecook: package: recipes: A package file run: abox [recipes/abox.rb] target <<"SCRIPT" echo "# I will not manually configure my server" SCRIPT
  • 52. Convert to Recipe [packages/abox.yml] linecook: package: A tempfile recipes: (packages/abox/run) run: abox [recipes/abox.rb] target <<"SCRIPT" echo "# I will not manually configure my server" SCRIPT
  • 53. Simplify [packages/abox.yml] If default, no {} manifest needed [recipes/abox.rb] target <<"SCRIPT" echo "# I will not manually configure my server" SCRIPT
  • 54. Build and Run [packages/abox.yml] {} [recipes/abox.rb] target <<"SCRIPT" echo "# I will not manually configure my server" SCRIPT linecook build linecook run # I will not manually configure my server
  • 55. Ok... that was boring.
  • 57. ERB Compiles to Ruby require 'erb' compiler = ERB::Compiler.new("<>") compiler.put_cmd = "target<<" compiler.insert_cmd = "target<<" compiler.compile "got <%= obj %>" # => "target<<"got "; target<<(( obj ).to_s)"
  • 58. InstanceEval for Context class Recipe attr_accessor :target def initialize @target = "" end def obj "milk" end end code = "target<<"got "; target<<(( obj ).to_s)" recipe = Recipe.new recipe.instance_eval(code) recipe.target # => "got milk"
  • 59. Make a Module module Helper def get(obj) target<<"got "; target<<(( obj ).to_s) end end recipe = Recipe.new recipe.extend Helper recipe.instance_eval %q{ get "milk" target << ", " get "cookies" } recipe.target # => "got milk, got cookies"
  • 60. Make a Module module Helper def get(obj) target<<"got "; target<<(( obj ).to_s) end end recipe = Recipe.new recipe.extend Helper recipe.instance_eval %q{ get "milk" target << ", " get "cookies" This is a recipe! } recipe.target # => "got milk, got cookies"
  • 61. Helpers [helpers/example/echo.erb] Write an echo statement (str) -- echo "<%= str %>" [recipes/abox.rb] helpers "example" echo "# I will not manually configure my server"
  • 62. Helpers [helpers/example/echo.erb] [lib/example.rb] Write an echo statement module Example (str) # Write an echo ... -- def echo(str) echo "<%= str %>" target<< "echo ";... end end [recipes/abox.rb] helpers "example" echo "# I will not manually configure my server"
  • 63. Helpers [helpers/example/echo.erb] [lib/example.rb] Write an echo statement module Example (str) # Write an echo ... -- def echo(str) echo "<%= str %>" target<< "echo ";... end end [recipes/abox.rb] helpers "example" echo "# I will not manually configure my server"
  • 64. Helpers [helpers/example/echo.erb] [lib/example.rb] Write an echo statement module Example (str) # Write an echo ... -- def echo(str) echo "<%= str %>" target<< "echo ";... end end [recipes/abox.rb] helpers "example" echo "# I will not manually configure my server"
  • 65. Helpers [helpers/example/echo.erb] [lib/example.rb] Write an echo statement module Example (str) # Write an echo ... -- def echo(str) echo "<%= str %>" target<< "echo ";... end end [recipes/abox.rb] helpers "example" echo "# I will not manually configure my server"
  • 66. Helpers [helpers/example/echo.erb] [lib/example.rb] Write an echo statement module Example (str) # Write an echo ... -- def echo(str) echo "<%= str %>" target<< "echo ";... end end [recipes/abox.rb] helpers "example" echo "# I will not manually configure my server"
  • 67. Helpers [helpers/example/echo.erb] [lib/example.rb] Write an echo statement module Example (str) # Write an echo ... -- def echo(str) echo "<%= str %>" target<< "echo ";... end end [recipes/abox.rb] helpers "example" echo "# I will not manually configure my server"
  • 68. Helpers [helpers/example/echo.erb] Write an echo statement (str) -- require "example" echo "<%= str %>" extend Example [recipes/abox.rb] helpers "example" echo "# I will not manually configure my server"
  • 69. Helpers [helpers/example/echo.erb] Write an echo statement (str) -- echo "<%= str %>" [recipes/abox.rb] helpers "example" echo "# I will not manually configure my server" linecook build linecook run # I will not manually configure my server
  • 70. Capture (no write) [helpers/example/color.erb] Add color to a string (color, str) codes = Hash[*%W{red 0;31 white 1;37 blue 0;34}] -- 033[<%= codes[color.to_s] %>m<%= str %>033[0m [recipes/abox.rb] helpers "example" msg = "# I will not manually configure my server" echo _color("blue", msg)
  • 71. Capture (no write) [helpers/example/color.erb] Add color to a string (color, str) codes = Hash[*%W{red 0;31 white 1;37 blue 0;34}] -- 033[<%= codes[color.to_s] %>m<%= str %>033[0m [recipes/abox.rb] helpers "example" msg = "# I will not manually configure my server" echo _color("blue", msg) Prefix with underscore String output used as input
  • 72. Capture (no write) [helpers/example/color.erb] Add color to a string (color, str) codes = Hash[*%W{red 0;31 white 1;37 blue 0;34}] -- 033[<%= codes[color.to_s] %>m<%= str %>033[0m [recipes/abox.rb] helpers "example" msg = "# I will not manually configure my server" echo _color("blue", msg) linecook build linecook run # I will not manually configure my server
  • 73. Recipes are Ruby [recipes/abox.rb] helpers "example" msg = "# I will not manually configure my server" 3.times do echo _color("blue", msg) end linecook build linecook run # I will not manually configure my server # I will not manually configure my server # I will not manually configure my server
  • 74. Advantages Easily extensible DSL Produces ordinary modules Test as any other Ruby Distribute as Gems (versions, bundler) Reprocessing of output Also, kind of cool...
  • 76. Logic + Pipelines [recipes/demo.rb] helpers 'linebook/shell' unless_ _file?('/tmp/message') do cat.to('/tmp/message').heredoc do writeln 'hello world!' end end cat('/tmp/message')
  • 77. Logic + Pipelines [packages/demo/run] if ! [ -f "/tmp/message" ] then cat > /tmp/message << HEREDOC_0 hello world! HEREDOC_0 fi cat "/tmp/message"
  • 78. Under Construction Exit status checks, ‘stack trace’ Helpers for login/su User and File Management Server-side testing (assert_script) Installs, config, deployments, etc.
  • 79. No need to wait!
  • 80. Linecook Attributes Helpers Recipes Packages Files Templates Server
  • 81. Learn More GitHub: pinnacol/linecook.git pinnacol/linebook.git Me: github.com/thinkerbot @thinkerbot

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. Not dismissing Chef when I say that. The advantages over manually writing setup/maintenance script are not to be underestimated. But for the most part things you do with Chef are things you would otherwise do with shell scripts, and there are problems.\n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. Just use the existing systems. Some &amp;#x2018;advanced&amp;#x2019; techniques but all established, known systems\nPrior experience applies any learning will feed back into existing workflow\n\n
  21. Able to bring an existing script to Linecook, then rework to make it more powerful or maintainable. You will work with scripts directly. Again all prior experience applies.\n\n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. Seems pointless, but here is where it gets cool.\n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n