/var/www/html
のシンボリックリンクが/vagrant
になってると何かと楽なので作ってみました。
directory '/var/www/html' do action :delete not_if { File.symlink?('/var/www/html') } end link "/var/www/html" do to "/vagrant" link_type :symbolic end
参考ブログ参照しながら作業してたけど、少しずつChefのドキュメントが読めるようになってきた。慣れだな。
参考
更新履歴
以前、
directory "/var/www/html" do action :delete not_if "test -L /var/www/html" end
と、記載していた部分を、
directory '/var/www/html' do action :delete not_if { File.symlink?('/var/www/html') } end
に変更しました。Stack Overflowで質問したところ、rubyの表現にしたほうがcross-platformに対応できるし速いということで! Thanks!