Install Linux Agent From Remote Server:
Code Block |
---|
remote_file "#{Chef::Config[:file_cache_path]}/installCloudamizeAgentV2.sh" do |
...
source 'https:// |
...
am.cloudamize.com/cxf/downloadFile/installCloudamizeAgentV2.sh' |
...
owner 'root' |
...
group 'root' |
...
mode '0755' |
...
action :create |
...
endexecute 'install Cloudamize Agent' do |
...
environment 'CLOUDAMIZE_CUSTOMER_KEY' => node['cloudamize_key']['token'] # Add cloudamize_key under default_attributes in customer chef |
...
user 'root' |
...
command "#{Chef::Config[:file_cache_path]}/installCloudamizeAgentV2.sh" |
...
creates '/usr/local/cloudamize' |
...
end |
Install Linux Agent Locally:
Code Block |
---|
cookbook_file "local_file.sh" do |
...
owner "root" |
...
group "root" |
...
mode "0755" |
...
path "/tmp/install_agent_v2.sh" |
...
end |
...
execute "install Cloudamize Agent" do |
...
environment { "CLOUDAMIZE_CUSTOMER_KEY" => node[:cloudamize][:customer_key] } |
...
command "/tmp/install_agent_v2.sh" |
...
creates "/usr/local/cloudamize" |
...
end |