I use chef to manage OS X workstations, slowly but surely moving out of my old
method of building pkg installers for everything than using munki.
Prior to updating to chef 12 (for instance running 11.12.8) on my bootstrapped
workstations this portion of a recipe I use to set a base config would work:
directory "/Users/#{node['current_user']}/.ssh" do
owner node['current_user']
mode "0700"
action :create
end
With the result being that an .ssh folder was created for the logged in admin
user, for instance foo-admin, not the root user.
However after updating to chef-client 12, this same recipe fails, as it tries
to create a .ssh folder for root, who doesn’t have a home at /Users.
Any ideas on how I can improve this so that I get my expected result?
I use chef to manage OS X workstations, slowly but surely moving out of my old
method of building pkg installers for everything than using munki.
Prior to updating to chef 12 (for instance running 11.12.8) on my bootstrapped
workstations this portion of a recipe I use to set a base config would work:
directory "/Users/#{node['current_user']}/.ssh" do
owner node['current_user']
mode "0700"
action :create
end
With the result being that an .ssh folder was created for the logged in admin
user, for instance foo-admin, not the root user.
However after updating to chef-client 12, this same recipe fails, as it tries
to create a .ssh folder for root, who doesn't have a home at /Users.
Any ideas on how I can improve this so that I get my expected result?
If you're running chef-client with sudo, then you may find this post
helpful - I wrote it with this kind of use case in mind (though not the
specific change in Chef 12 that you encountered).
I use chef to manage OS X workstations, slowly but surely moving out of my
old
method of building pkg installers for everything than using munki.
Prior to updating to chef 12 (for instance running 11.12.8) on my
bootstrapped
workstations this portion of a recipe I use to set a base config would
work:
directory "/Users/#{node['current_user']}/.ssh" do
owner node['current_user']
mode "0700"
action :create
end
With the result being that an .ssh folder was created for the logged in
admin
user, for instance foo-admin, not the root user.
However after updating to chef-client 12, this same recipe fails, as it
tries
to create a .ssh folder for root, who doesn't have a home at /Users.
Any ideas on how I can improve this so that I get my expected result?
I use chef to manage OS X workstations, slowly but surely moving out of my old
method of building pkg installers for everything than using munki.
Prior to updating to chef 12 (for instance running 11.12.8) on my bootstrapped
workstations this portion of a recipe I use to set a base config would work:
directory "/Users/#{node['current_user']}/.ssh" do
owner node['current_user']
mode "0700"
action :create
end
With the result being that an .ssh folder was created for the logged in admin
user, for instance foo-admin, not the root user.
However after updating to chef-client 12, this same recipe fails, as it tries
to create a .ssh folder for root, who doesn't have a home at /Users.
Note that the semantics for node['current_user'] changed in Chef 12/Ohai 8
to correct confusing behavior when running under sudo.