Skip to content

Commit

Permalink
Merge pull request #124 from chef-cookbooks/issues_118
Browse files Browse the repository at this point in the history
Resolves Issue 118 fixing provider to work on Mac OS X
  • Loading branch information
iennae committed Dec 20, 2015
2 parents 3ea00f3 + 82e8e60 commit 335ca0c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 deletions.
20 changes: 20 additions & 0 deletions .kitchen.vmware.yml
@@ -0,0 +1,20 @@
driver:
name: vagrant
provider: vmware_fusion
customize:
numvcpus: 2
memsize: 2048

provisioner:
name: chef_zero

platforms:
# - name: macosx-10.8
# driver:
# box: chef/macosx-10.8 # private
# - name: macosx-10.9
# driver:
# box: chef/macosx-10.9 # private
- name: macosx-10.11
driver:
box: chef/macosx-10.11 # private
16 changes: 8 additions & 8 deletions providers/manage.rb
Expand Up @@ -115,16 +115,16 @@ def search_missing?
Chef::Log.debug("Managing home files for #{u['username']}")

directory "#{home_dir}/.ssh" do
owner u['username']
group u['gid'] || u['username']
owner u['uid']
group u['gid'] if u['gid']
mode '0700'
end

template "#{home_dir}/.ssh/authorized_keys" do
source 'authorized_keys.erb'
cookbook new_resource.cookbook
owner u['username']
group u['gid'] || u['username']
owner u['uid']
group u['gid'] if u['gid']
mode '0600'
variables ssh_keys: u['ssh_keys']
only_if { u['ssh_keys'] }
Expand All @@ -135,8 +135,8 @@ def search_missing?
template "#{home_dir}/.ssh/id_#{key_type}" do
source 'private_key.erb'
cookbook new_resource.cookbook
owner u['id']
group u['gid'] || u['id']
owner u['uid']
group u['gid'] if u['gid']
mode '0400'
variables private_key: u['ssh_private_key']
end
Expand All @@ -147,8 +147,8 @@ def search_missing?
template "#{home_dir}/.ssh/id_#{key_type}.pub" do
source 'public_key.pub.erb'
cookbook new_resource.cookbook
owner u['id']
group u['gid'] || u['id']
owner u['uid']
group u['gid'] if u['gid']
mode '0400'
variables public_key: u['ssh_public_key']
end
Expand Down

0 comments on commit 335ca0c

Please sign in to comment.