Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Opening - Itamae Meetup#1

Ryota Arai
December 09, 2015

Opening - Itamae Meetup#1

Ryota Arai

December 09, 2015
Tweet

More Decks by Ryota Arai

Other Decks in Programming

Transcript

  1. Itamae • Recipes • Cookbooks -> Recipe • Roles ->

    Recipe • Environments -> Recipe • Berkshelf -> Gem, Bundler
  2. Itamae # recipe.rb package "nginx" service "nginx" template "/etc/nginx/nginx.conf" do

    notifies :restart, "service[nginx]" end $ itamae local recipe.rb $ itamae ssh -h your-server recipe.rb
  3. Itamaeͷݱঢ় • 513 stars • 802 commits • 38 plugin

    gems • 35 contributors • ?? users
  4. --profileΦϓγϣϯ $ itamae local --profile /path/to/profile.json recipe.rb $ cat /path/to/profile.json

    | jq . | head [ { "command": "mkdir -p /tmp/itamae_tmp", "duration": 0.0037856101989746094 }, { "command": "chmod 777 /tmp/itamae_tmp", "duration": 0.0025980472564697266 }, {
  5. $ cat config.yml handlers: - type: json path: /path/to/itamae-log.json $

    itamae local -c config.yml recipe.rb $ cat /tmp/itamae-log.json | head {"time":"2015-12-08T15:47:55+09:00","event":"recipe_started", "payload":{"path":"/Users/ryota-arai/src/github.com/ryotarai/itamae/tmp/recipe.rb"}} {"time":"2015-12-08T15:47:55+09:00","event":"resource_started", "payload":{"resource_type":"execute","resource_name":"echo included"}} {"time":"2015-12-08T15:47:55+09:00","event":"action_started", "payload":{"action":"run"}} {"time":"2015-12-08T15:47:55+09:00","event":"attribute_changed", "payload":{"from":{"executed":false}, "to":{"action":"run","command":"echo included","executed":true}}}
  6. Handler • debug handler • ϩάग़ྗ • json handler •

    JSON per lineͰϑΝΠϧग़ྗ • fluentd handler • fluent-loggerͰFluentdʹग़ྗ
  7. Handler Gem # lib/itamae/handler/mail.rb module Itamae module Handler class Mail

    < Base def event(type, payload = {}) super send_mail(subject: type.to_s, body: payload.inspect) end end end end
  8. omnibus-itamae • ϏϧυࡁΈύοέʔδˏBintray • Ubuntu 14.04, CentOS 7༻ • खݩͰ΋ϏϧυՄೳ

    $ echo 'deb https://dl.bintray.com/itamae/itamae trusty contrib' | sudo tee /etc/apt/sources.list.d/itamae.list $ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv D401AB61 $ sudo apt-get update $ sudo apt-get install itamae
  9. ϑΟʔυόοΫΛٻΊ͍ͯ·͢ • Twi%erͰ@ryot_a_rai • Slack: h%ps:/ /itamae-slackin.herokuapp.com/ • Issue: h%ps:/

    /github.com/itamae-kitchen/itamae/issues • PR: h%ps:/ /github.com/itamae-kitchen/itamae/pulls