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

machine_agent.rb recipe: extracting -> config change -> restart on every chef run #89

Open
rediculum opened this issue Dec 19, 2018 · 1 comment

Comments

@rediculum
Copy link

There are some conditions missing in the remote_file agent_zip and execute 'unzip-appdynamics-machine-agent' resource. On each chef run, the ZIP file is extracted again and the configuration file is been altered. This leads to a restart of the machine agent on every chef run.

@rediculum
Copy link
Author

Add a condition to extract only if the ./bin directory is missing and the default action for the unzip task is nothing.

remote_file agent_zip do
  source package_source
  checksum agent['checksum']
  backup false
  mode '0444'
  notifies :run, 'execute[unzip-appdynamics-machine-agent]', :immediately
end unless ::File.exist?([agent['install_dir'], '/bin'].join)
...
...
execute 'unzip-appdynamics-machine-agent' do
  cwd agent['install_dir']
  command "unzip -qqo #{agent_zip}"
  action :nothing
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant