Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for resource cloning deprecation #112

Merged
merged 1 commit into from
Feb 20, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions providers/account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def load_current_resource
action :create do # ~FC017: LWRP does not notify when updated
user_resource :create
home_dir_resource :create
home_ssh_dir_resource :create if @ssh_keygen || !new_resource.ssh_keys.empty?
authorized_keys_resource :create
keygen_resource :create
group_resource :create
Expand All @@ -54,27 +55,31 @@ def load_current_resource
action :modify do # ~FC017: LWRP does not notify when updated
user_resource :modify
home_dir_resource :create
home_ssh_dir_resource :create if @ssh_keygen || !new_resource.ssh_keys.empty?
authorized_keys_resource :create
keygen_resource :create
end

action :manage do # ~FC017: LWRP does not notify when updated
user_resource :manage
home_dir_resource :create
home_ssh_dir_resource :create if @ssh_keygen || !new_resource.ssh_keys.empty?
authorized_keys_resource :create
keygen_resource :create
end

action :lock do # ~FC017: LWRP does not notify when updated
user_resource :lock
home_dir_resource :create
home_ssh_dir_resource :create if @ssh_keygen || !new_resource.ssh_keys.empty?
authorized_keys_resource :create
keygen_resource :create
end

action :unlock do # ~FC017: LWRP does not notify when updated
user_resource :unlock
home_dir_resource :create
home_ssh_dir_resource :create if @ssh_keygen || !new_resource.ssh_keys.empty?
authorized_keys_resource :create
keygen_resource :create
end
Expand Down Expand Up @@ -172,8 +177,6 @@ def authorized_keys_resource(exec_action)
# avoid variable scoping issues in resource block
ssh_keys = Array(new_resource.ssh_keys)
unless ssh_keys.empty?
home_ssh_dir_resource(exec_action)

resource_gid = user_gid
r = template "#{@my_home}/.ssh/authorized_keys" do
cookbook 'user'
Expand Down Expand Up @@ -209,7 +212,6 @@ def keygen_resource(exec_action)

creates "#{my_home}/.ssh/id_rsa"
end
home_ssh_dir_resource(exec_action)
e.run_action(:run) if @ssh_keygen && exec_action == :create
new_resource.updated_by_last_action(true) if e.updated_by_last_action?

Expand Down