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

Only set up puppet integration if needed #168

Merged
merged 1 commit into from Jul 2, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 6 additions & 5 deletions manifests/init.pp
Expand Up @@ -259,11 +259,12 @@
# parameter values from the main ::certs class. Kafo can't handle that case, so
# it remains here for now.
include ::puppet
include ::puppet::server
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was silently pulling in the puppet server which users might not want. The main puppet class has a parameter whether to include it and also correct chaining. You might be right that there are cases where a user has manually included it and this isn't correct. Coupling to other modules is annoying.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sean797 do you think I should add a fail() instead when those variables are false?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to add it inside the if statement ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you man by it here? The include or a fail() message?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry the include, so

if $::puppet::server and $::puppet::server::foreman {
  include ::puppet::server

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in that case, I'm okay with this 👍

class { '::certs::puppet':
hostname => $foreman_proxy_fqdn,
require => Class['certs'],
notify => Class['puppet'],
if $::puppet::server and $::puppet::server::foreman {
class { '::certs::puppet':
hostname => $foreman_proxy_fqdn,
require => Class['certs'],
before => Class['puppet'],
}
}
}

Expand Down