Opening - Itamae Meetup#1

Ff2949d62ab50cb0095c769882ffe018?s=47 Ryota Arai
December 09, 2015

Opening - Itamae Meetup#1

Ff2949d62ab50cb0095c769882ffe018?s=128

Ryota Arai

December 09, 2015
Tweet

Transcript

  1. 5.
  2. 7.

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

    Recipe • Environments -> Recipe • Berkshelf -> Gem, Bundler
  3. 8.

    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
  4. 9.

    Itamaeͷݱঢ় • 513 stars • 802 commits • 38 plugin

    gems • 35 contributors • ?? users
  5. 10.
  6. 12.
  7. 14.
  8. 21.
  9. 25.

    --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 }, {
  10. 27.
  11. 29.

    $ 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}}}
  12. 30.

    Handler • debug handler • ϩάग़ྗ • json handler •

    JSON per lineͰϑΝΠϧग़ྗ • fluentd handler • fluent-loggerͰFluentdʹग़ྗ
  13. 32.

    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
  14. 37.

    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
  15. 40.
  16. 41.
  17. 44.

    ϑΟʔυόοΫΛٻΊ͍ͯ·͢ • 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