Skip to content

Instantly share code, notes, and snippets.

@wshino
Created February 6, 2014 10:26
Show Gist options
  • Save wshino/8841744 to your computer and use it in GitHub Desktop.
Save wshino/8841744 to your computer and use it in GitHub Desktop.
jenkins用のrecipeを書いてみたけど再帰で権限が変更されないのなんで
env = node[:base][:env]
cookbook_file "/etc/sysconfig/jenkins" do
source "build/etc/sysconfig/jenkins"
owner "root"
group "root"
mode "0600"
end
%W{ /var/log/jenkins /var/cache/jenkins /var/lib/jenkins }.each do |path|
directory path do
owner "ope"
group "ope"
mode 00755
recursive true
end
end
@wshino
Copy link
Author

wshino commented Feb 6, 2014

すでにあるディレクトリはrecursive trueでもうまく変更できんらしい、どういう解決策がいいんだろう。

@wshino
Copy link
Author

wshino commented Feb 7, 2014

bash "change directory owner" do
  user "root"
  code <<-EOH
  chown -R ope:ope /var/log/jenkins
  chown -R ope:ope /var/cache/jenkins
  chown -R ope:ope /var/lib/jenkins
  EOH
end

こういう逃げ方しかないのかな?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment