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

fix ca_cert::update in resource ca_cert::ca #44

Closed
wants to merge 1 commit into from

Conversation

basti-nis
Copy link

due to the bug:
Could not find resource 'Class[Ca_cert::Update]' in parameter 'notify' at /etc/puppetlabs/code/environments/*******/modules/ca_cert/manifests/ca.pp:98
on puppetrun if only following code is declared in the .pp-file:

ca_cert::ca { '':
ensure => 'trusted',
source => "puppet:///modules/standard/ca_cert/
",
}

due to the bug:
Could not find resource 'Class[Ca_cert::Update]' in parameter 'notify' at /etc/puppetlabs/code/environments/*******/modules/ca_cert/manifests/ca.pp:98

On puppetrun if only
  ca_cert::ca { '****':
    ensure => 'trusted',
    source => "puppet:///modules/standard/ca_cert/****",
  }

is used in puppet code
@basti-nis
Copy link
Author

I ran in following error on puppet run:
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Could not find resource 'Class[Ca_cert::Update]' in parameter 'notify' at /etc/puppetlabs/code/environments//modules/ca_cert/manifests/ca.pp:98 on node xxxxxx

This code is declared in the node.pp:
ca_cert::ca { 'xxxxxxxx':
ensure => 'trusted',
source => "puppet:///modules/xxxxxx/ca_cert/xxxxxxxxx",
}

I've checked the code in ca.pp and add the line:
include ::ca_cert::update

after that it's working

@basti-nis basti-nis changed the title fix ca_cert::update fix ca_cert::update in resource ca_cert::ca Mar 27, 2018
@pcfens
Copy link
Contributor

pcfens commented Mar 27, 2018

Thanks for thinking this through @basti-nis. I think that this might need more of a documentation fix than a code change though. It's best that include ::ca_cert be dropped somewhere in the main manifest before any ca resources are declared.

The base class also ensures that the right packages are installed for puppet to manage CAs on a particular host.

Thoughts?

@greatflyingsteve
Copy link

If the module is incompatible with part of your fleet (say you have some oddball Windows or AIX or Solaris hosts, or some hosts use a different module to manage their CA certs), then dropping an include into the main (and thus, global) manifest is infeasible. If multiple ca_cert::ca resources are used in different places in a host's catalog, it can also be difficult to know where to add an include ::ca_cert so that the catalog isn't parse-order dependent. If you know inside the define that it will not work without an ancillary class, it is better to do an include of that class in the body of the define than to ask the user to do that for you - although it might be better in this case to include the module's base class than to include just the update class. If configuration other than default is needed first, THEN ask the user to include the class first themselves. Or at least, that's how it seems to me.

@greatflyingsteve
Copy link

...of course, I say all this, then look at the most recent release and it's already a solved problem. Nevermind!

@h-haaks
Copy link
Contributor

h-haaks commented May 9, 2024

Fixed by #79

@h-haaks h-haaks closed this May 9, 2024
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.

4 participants