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

Remote keep_existing from archive_file resource #123

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 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
14 changes: 10 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

This file is used to list changes made in each version of the `newrelic-infra` cookbook.

## 0.12.2 (2021-10-25)

* Removed keep_existing property from archive_file
* Uses `remote_file` to download an integration with a remote source URL and maintain a local path with `archive_file` when
the installation method is tarball

## 0.12.1 (2021-09-08)

FEATURES:
Expand All @@ -14,24 +20,24 @@ BREAKING CHANGES:
* The minimum supported Chef version is now 15+ instead of 12.5+.
* Removed `poise_service` and `poise_archive` dependencies, `agent_linux.rb` rewritten to use Chef resources instead.
* Change of creation of config file and it's location - removed `agent.yaml` and changed it to `newrelic.yml` in `/etc`.

## 0.11.0 (2019-07-04)

FEATURES:

* Add support for Amazon Linux 2.
* Add support for Amazon Linux 2.

IMPROVEMENTS:

* Add support for disabling the removal of quotes in the generated
* Add support for disabling the removal of quotes in the generated
integration definition and config files.

## 0.10.0 (2019-05-27)

FEATURES:

* Add support for installing the agent in different linux architecture from the
tarballs.
tarballs.

## 0.9.0 (2019-03-29)

Expand Down
14 changes: 11 additions & 3 deletions libraries/integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,18 @@ def config_file_content
only_if { new_resource.install_method == 'binary' }
end

# Fetch the remote executable tarball if the install method is set to `tarball`
archive_file new_resource.remote_url do
# Fetch the remote tarball if the install method is set to 'tarball'
remote_file ::File.basename(new_resource.remote_url) do
user new_resource.user
group new_resource.group
path ::File.join(new_resource.bin_dir, new_resource.name)
source new_resource.remote_url
only_if { new_resource.install_method == 'tarball' }
end

# Unzip tarball if the install method is set to `tarball` (archive_file doesn't support remote source urls)
archive_file ::File.basename(new_resource.remote_url) do
destination ::File.join(new_resource.bin_dir, new_resource.name)
keep_existing true
only_if { new_resource.install_method == 'tarball' }
end

Expand Down