#author("2017-05-22T09:33:12+00:00","default:kazuma","kazuma")
[[itamae]]

*レシピを実行(Vagrant) [#cef0499c]
*** dryrun [#y9813639]
 $ itamae ssh --vagrant receip.rb --dry-run

*** 適用 [#z1ad684b]
 $ itamae ssh --vagrant receip.rb

*** yamlファイル指定 [#a811cb0b]
  $ itamae ssh --vagrant receip.rb -y node/development.yaml

*ユーザー作成 [#h233b959]
 user "create user" do
  username "ユーザー名"
  password "パスワード"
 end

*ファイルの転送 [#d2ce4f3e]
 remote_file "/etc/yum.repos.d/docker-ce.repo" do
   owner  "root"
   group  "root"
   mode   "644"
   source "templates/etc/yum.repos.d/docker-ce.repo"
 end

*パッケージのインストール [#k8534b90]
 package "docker-ce" do
   action :install
   only_if "test -e /etc/yum.repos.d/docker-ce.repo"
 end

*サービスの起動と自動起動 [#u908aa7d]
 service "docker" do
   action [:start, :enable]
 end

*yamlで変数指定 [#wa1029f3]
 $ vim node/development.yaml
 hoge:
   piyo: 値
 $ vim templates/test.erb
 <%= node[:hoge][:piyo] %>

*ファイルの編集 [#o9544efd]
*** 特定の文字列がなかったら追記 [#u07dac52]
 file "/etc/fstab" do
  action :edit
  block do | content |
     unless content =~ /192.168.100.100/
     content.concat <<-EOS
 
 ### TEST
 192.168.100.100:/mnt/array1/test01 /mnt/test01  nfs defaults,noatime 0 0
     EOS
     end
  end
  only_if "test -d /mnt/test01"
 end

*シェルコマンドの実行 [#be06799e]
 execute "update openssl" do
  user "root"
  command "yum -y udpate openssl"
 end


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS