Hi Guys I am working on below code snippet. I tried various combinations with I am not able to call manage_auth or authorized_users_ldap from RemoteFile
I am able to notify manage_auth or authorized_users_ldap from ruby_block "manage_operator" but not from RemoteFile
I want to trigger either of the 2 (manage_auth or authorized_users_ldap) if manage_operator_flag is equal to 1. Thus I tried putting a notify on remote_file, but that is not getting triggered. Please let me know what I am doing wrong
ruby_block "manage_auth" do
block do
Chef::Log.info("MANAGE AUTH")
end
action :nothing
end
ruby_block "manage_operator" do
block do
manage_operator_flag = (cfg.fetch("manage.operators", 0) == 1)
if (manage_operator_flag) then
f = Chef::Resource::File::RemoteFile.new("#{node['ucms']['dir']}/bin/ucms_authorized_users_ldap.json", run_context)
f.source "https://ca.#{c}.#{p}.axiadids.net:4443/ucms_authorized_users_ldap.json"
f.retries 3
f.retry_delay 10
f.ignore_failure true
# f.run_action :create
f.action :create
# f.notifies :run, "execute[authorized_users_ldap]"
# f.notifies(:run, Chef::Resource::Execute.new("authorized_users_ldap", run_context))
f.notifies :run, "ruby_block[manage_auth]"
end
end
end
execute "authorized_users_ldap" do
command "touch /tmp/test"
action :nothing
end