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

[dev.icinga.com #12809] Path of Puppet keys and certs broken #122

Closed
icinga-migration opened this issue Sep 27, 2016 · 8 comments
Closed
Labels
Milestone

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/12809

Created by bsheqa on 2016-09-27 13:00:17 +00:00

Assignee: bsheqa
Status: Closed (closed on 2016-09-30 08:20:49 +00:00)
Target Version: v0.5.0
Last Update: 2016-09-30 08:20:49 +00:00 (in Redmine)


Quote "Reamer" on GitHub:

The path contains the path from puppetmaster and not from agent. So the path is not right if you have puppet 3 and puppet 4 agents mix. Maybe also windows agents have problems, but i doesn't use puppet on windows.
https://docs.puppet.com/puppet/latest/reference/lang_facts_and_builtin_vars.html#puppet-master-variables
Take a look into https://github.com/Icinga/puppet-icinga2/pull/197

Is there a way to fix this without creating a custom fact?


Relations:

@icinga-migration
Copy link
Author

Updated by shoenscheid on 2016-09-28 10:52:01 +00:00

There are variables for the ssl base path. Puppet uses them in puppet.conf. these variables are also available for usage in puppet lang.

@icinga-migration
Copy link
Author

Updated by Reamer on 2016-09-28 20:32:52 +00:00

@shoenscheid
How i can use this variables in puppet manifest? Do you have an example code fragment?

@icinga-migration
Copy link
Author

Updated by lbetz on 2016-09-28 21:24:29 +00:00

But the name of the fact should be changed...

Facter.add(:settings) do
Puppet.settings.preferred_run_mode= :agent

settings = Hash.new
settings['hostcert'] = Puppet.settings[:hostcert]
settings['hostprivkey'] = Puppet.settings[:hostprivkey]
settings['localcacert'] = Puppet.settings[:localcacert]

setcode do
settings
end
end

@icinga-migration
Copy link
Author

Updated by lbetz on 2016-09-29 08:09:05 +00:00

  • Status changed from New to Assigned
  • Assigned to set to lbetz

@icinga-migration
Copy link
Author

Updated by bsheqa on 2016-09-29 12:57:08 +00:00

The current implementatio in "bug/path-of-Puppet-keys-and-certs-broken-12809" works only if "stringify_facts = false".
On a Ubuntu Trusty installation using the Puppetlabs repo, stringify_facts is true by default. This makes it impossible to use a fact that is a hash.

A hashed fact would suit better in this case, but we should use strings for compatibility reasons.

Find my solution in the branch "bug/icinga2-puppet-settings-facts-12809".
I intentionally did not iterate over Puppet.settings because 'to_h' is not available until Ruby 2.1

@icinga-migration
Copy link
Author

Updated by Reamer on 2016-09-29 21:35:11 +00:00

I prefer also the branch "bug/icinga2-puppet-settings-facts-12809". The code should work also with older puppet version.
I also like the full path to all three files, so this commit is better then the Merge-Request.

@icinga-migration
Copy link
Author

Updated by bsheqa on 2016-09-30 08:20:49 +00:00

  • Status changed from Assigned to Closed
  • Assigned to changed from lbetz to bsheqa
  • Done % changed from 0 to 100

Merged bug/icinga2-puppet-settings-facts-12809 into master

@icinga-migration
Copy link
Author

Updated by bsheqa on 2016-10-07 11:29:42 +00:00

  • Relates set to 12871

@icinga-migration icinga-migration added this to the v0.5.0 milestone Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant