詳細
bashでbashコマンドの実行をします。
Chefで提供されている機能では出来ないことがある場合などに利用します。
例
home = "/home/user_name"
bash "insert_line" do
user "root"
code <<-EOS
echo "alias='vi=vim' >> #{home}/.bash_profile
source #{home}/.bash_profile
EOS
end
.bash_profileにエイリアスを追記して再読込(environment Attributeを利用した例)
2014/01/19追記:llbyさんから頂いたコメントを参考に致しました。ありがとうございます。
home = "/home/user_name"
bash "insert_line" do
user "root"
environment "HOME" => "/home/vagrant"
code <<-EOS
echo "alias='vi=vim' >> ~/.bash_profile
source ~/.bash_profile
EOS
end