カメニッキ

カメとインコと釣りの人です

itamae使ってみた

itamaeとは?

シンプルで軽量な構成管理ツール(ansibleの時も書いた)Chefインスパイア

特徴として、

  • ChefっぽいDSL
  • Chefよりシンプルで軽量
  • Chefとの互換性はない

前提

CentOS 6.6をつかってます。 参考→itamae-kitchen/itamae

インストール

ruby(※既にあるなら不要)

[vagrant@itamaeserver ~]$ sudo yum -y install gcc zlib-devel openssl-devel sqlite sqlite-devel mysql-devel readline-devel libffi-devel
[vagrant@itamaeserver ~]$ cd /usr/local/src/
[vagrant@itamaeserver src]$ sudo wget http://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.2.tar.gz
[vagrant@itamaeserver src]$ sudo tar xvfz ruby-2.2.2.tar.gz
[vagrant@itamaeserver src]$ cd ruby-2.2.2
[vagrant@itamaeserver ruby-2.2.2]$ sudo ./configure
[vagrant@itamaeserver ruby-2.2.2]$ sudo make
[vagrant@itamaeserver ruby-2.2.2]$ sudo make install

# PATHをとおして
[vagrant@itamaeserver ~]$ ruby -v
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
[root@itamaeserver ~]# sudo visudo
Defaults    secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin

itamaeインストール

[vagrant@itamaeserver tmp]$ sudo gem install itamae

recipeを書いてあててみる

[vagrant@itamaeserver tmp]$ sudo vi recipe.rb
package 'httpd' do
        action :install
end

service 'httpd' do
        action [:enable, :start]
end
[vagrant@itamaeserver tmp]$ itamae ssh --host 192.168.50.7 recipe.rb

HELPをみる

**[vagrant@itamaeserver tmp]$ itamae help
Commands:
  itamae docker RECIPE [RECIPE...] --image=IMAGE  # Create Docker image
  itamae help [COMMAND]                           # Describe available commands or one specific command
  itamae local RECIPE [RECIPE...]                 # Run Itamae locally
  itamae ssh RECIPE [RECIPE...]                   # Run Itamae via ssh
  itamae version                                  # Print version

Options:
  -l, [--log-level=LOG_LEVEL]
                               # Default: info
      [--color], [--no-color]
                               # Default: true**
[vagrant@itamaeserver tmp]$ itamae help ssh
usae:
  itamae ssh RECIPE [RECIPE...]

  Options:
  [--dot=PATH]                           # Only write dependency graph in DOT
  -j, [--node-json=NODE_JSON]
  -y, [--node-yaml=NODE_YAML]
  -n, [--dry-run], [--no-dry-run]
  -h, [--host=HOST]
  -u, [--user=USER]
(略)

感想

ヘルプがとてもみやすい

構成がシンプルだからか、日本人作だからか、英語力がなくてもわかりやすい Home · itamae-kitchen/itamae Wiki