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

Apt update before installation of collectd #889

Merged
merged 3 commits into from
Oct 1, 2019

Conversation

theosotr
Copy link
Contributor

@theosotr theosotr commented Aug 6, 2019

Hi

It seems to me that there is not any dependency between Exec['apt_update'] and Package['collectd'].
Specifically, this is what I get in noop mode: apt-update is run after the installation of the collectd package.

Notice: Compiled catalog for 067d02440e1f in environment production in 0.48 seconds
Notice: /Stage[main]/Apt/Apt::Setting[conf-update-stamp]/File[/etc/apt/apt.conf.d/15update-stamp]/ensure: current_value absent, should be file (noop)
Notice: Apt::Setting[conf-update-stamp]: Would have triggered 'refresh' from 1 events
Notice: /Stage[main]/Apt/File[preferences]/ensure: current_value absent, should be file (noop)
Notice: Class[Apt]: Would have triggered 'refresh' from 2 events
Notice: Class[Collectd::Repo::Debian]: Would have triggered 'refresh' from 1 events
Notice: /Stage[main]/Collectd::Install/Package[collectd]/ensure: current_value purged, should be present (noop)
Notice: /Stage[main]/Collectd::Install/Package[collectd-core]/ensure: current_value purged, should be present (noop)
Notice: Class[Collectd::Install]: Would have triggered 'refresh' from 2 events
Notice: Class[Apt::Update]: Would have triggered 'refresh' from 2 events
Notice: /Stage[main]/Apt::Update/Exec[apt_update]: Would have triggered 'refresh' from 1 events
Notice: Class[Apt::Update]: Would have triggered 'refresh' from 1 events
Notice: /Stage[main]/Collectd::Config/File[collectd.d]/ensure: current_value absent, should be directory (noop)

You can reproduce it by viewing the compiled catalog.

Indeed, the class Apt::Update is contained inside Stage[main] and not inside the class Collectd::Repo::Debian as you might expect.

@bastelfreak
Copy link
Member

Hi @theosotr, thanks for the PR. Can you please add a test for this change?

@theosotr
Copy link
Contributor Author

theosotr commented Aug 6, 2019

@bastelfreak, thanks for your reply.

I added the test cases as you requested.

@theosotr
Copy link
Contributor Author

More details in the official documentation of puppetlabs-apt:
https://github.com/puppetlabs/puppetlabs-apt#adding-new-sources-or-ppas

@bastelfreak
Copy link
Member

@theosotr can you take a look at the failing spec tests?

@theosotr
Copy link
Contributor Author

@bastelfreak it seems to me that the error is not related to my patch.

..

An error occurred while loading ./spec/defines/collectd_plugin_curl_json_spec.rb.

Failure/Error: case facts[:os]['family']

NoMethodError:

  undefined method `[]' for nil:NilClass

@bastelfreak
Copy link
Member

@theosotr sorry that this took so long. I fixed the error in another PR and rebased this one. Will merge it when it turns green.

@bastelfreak bastelfreak merged commit 5e710ab into voxpupuli:master Oct 1, 2019
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

Successfully merging this pull request may close these issues.

2 participants