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

Using lazy to fix attribute handling in resources and fix cases for chocolatey package upgrade #80

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
16 changes: 8 additions & 8 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@
# limitations under the License.

telegraf_install 'default' do
include_repository node['telegraf']['include_repository']
install_version node['telegraf']['version']
install_type node['telegraf']['install_type']
include_repository lazy { node['telegraf']['include_repository'] }
install_version lazy { node['telegraf']['version'] }
install_type lazy { node['telegraf']['install_type'] }
action :create
end

telegraf_config 'default' do
path node['telegraf']['config_file_path']
config node['telegraf']['config']
outputs node['telegraf']['outputs']
perf_counters node['telegraf']['perf_counters']
inputs node['telegraf']['inputs']
path lazy { node['telegraf']['config_file_path'] }
config lazy { node['telegraf']['config'] }
outputs lazy { node['telegraf']['outputs'] }
perf_counters lazy { node['telegraf']['perf_counters'] }
inputs lazy { node['telegraf']['inputs'] }
end
8 changes: 8 additions & 0 deletions resources/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@
end

if platform_family? 'windows'
if telegraf_install?
service "telegraf_#{new_resource.name}" do
service_name 'telegraf'
action [:stop]
only_if { ::Win32::Service.exists?('telegraf') }
end
end

chocolatey_package 'telegraf' do
version new_resource.install_version
source node['telegraf']['chocolatey_source']
Expand Down