-
Notifications
You must be signed in to change notification settings - Fork 47
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
Ref #9134 - gb plugin sets configs for foreman-gutterball #58
Conversation
b0b8f48
to
27015e3
Compare
@@ -0,0 +1,2 @@ | |||
<%# for foreman_gutterball plugin %> | |||
:url: <%= @fqdn %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should have :8443/gutterball
on the end, i believe. other than that, i will see if i can test this on monday!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressing
A more tpyical convention would be to create |
class katello::plugin::foreman_gutterball_config( | ||
$foreman_user = 'foreman', | ||
$foreman_group = 'foreman', | ||
$foreman_plugins_dir = '/usr/share/foreman/plugins', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is the right location for the file to get laid down. I believe it should be /etc/foreman/settings.plugins.d/
. See https://github.com/theforeman/foreman/blob/develop/config/settings.rb#L14
c81439d
to
324ed5a
Compare
@ehelms, @komidore64 , @ekohl
|
@@ -1,9 +1,26 @@ | |||
# gutterball plugin | |||
class katello::plugin::gutterball{ | |||
$foreman_gutterball_gem_config_tmp = '/tmp/foreman_gutterball.yaml' | |||
|
|||
$package = "${foreman::plugin_prefix}gutterball" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole block appears to be unused.
6573d9f
to
b95683b
Compare
@ekohl updated. |
$foreman_plugins_dir = '/etc/foreman/plugins', | ||
){ | ||
|
||
file { "${foreman_plugins_dir}/foreman_gutterball_auxiliary.yaml": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 'auxiliary' ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's a good name...forman_gutterball_url?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about just foreman_gutterball.yaml
? I don't see why it needs a special name when it is simply the config file for foreman_gutterball.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd use gutterball.yaml since the plugin is also named gutterball. In the PR I mentioned I will also default to that if you don't specify a config filename.
b95683b
to
b83f77a
Compare
@@ -0,0 +1,6 @@ | |||
:foreman_gutterball_url: | |||
:protocol: <%= @protocol %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the plugin use these variables? I'd only parameterize the configuration parameters that the plugin actually uses.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@komidore64 do you think there is any value for foreman-gutterball to have discrete portions of the url?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could go either way. i was doing similar to what is found in katello's config
for example:
common:
# ...
candlepin:
url: https://localhost:8443/candlepin
ffd5a89
to
e21bfb0
Compare
@komidore64, @ehelms, @ekohl
|
$foreman_plugins_dir = '/etc/foreman/plugins', | ||
$protocol = 'https', | ||
$port = '8443', | ||
$path = 'gutterball/', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we typically defer to leading slashes instead of trailing slashes for URL paths.
e21bfb0
to
e840e4a
Compare
@ehelms updated |
e840e4a
to
d92512d
Compare
APT |
@@ -0,0 +1,2 @@ | |||
:foreman_gutterball: | |||
:url: <%= @protocol %>://<%= @fqdn %>:<%= @port %><%= @path %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one last thing...
let's stick with the keys being strings instead of symbols, so we can stay uniform with other configs.
so
foreman_gutterball:
url: <%= @protocol %>://<%= @fqdn %>:<%= @port %><%= @path %>
5b3e5ae
to
11b15d4
Compare
@komidore64 updated |
awesome! ack pending tests |
$foreman_user = 'foreman', | ||
$foreman_group = 'foreman', | ||
$foreman_plugins_dir = '/etc/foreman/plugins', | ||
$protocol = 'https', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think a single URL parameter is easier than all the separate components. Now you're still forced to use the fqdn which a user might not want.
11b15d4
to
aefb5e8
Compare
@ekohl updated to a single url param |
$url = "https://${fqdn}:8443/gutterball", | ||
){ | ||
|
||
file { "${foreman_plugins_dir}/foreman_gutterball.yaml": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd name this simply gutterball.yaml since foreman is implied.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer things are explicit and match the plugin name. That way there is
no translation or discrepancy whenever you are looking for something
related. I think that the namespace of the plugins config and the file
containing it should remain the same.
On Feb 3, 2015 7:58 AM, "Ewoud Kohl van Wijngaarden" <
notifications@github.com> wrote:
In manifests/plugin/gutterball/config.pp
#58 (comment):@@ -0,0 +1,15 @@
+# gutterball config
+class katello::plugin::gutterball::config(
- $foreman_user = 'foreman',
- $foreman_group = 'foreman',
- $foreman_plugins_dir = '/etc/foreman/plugins',
$url = "https://$ {fqdn}:8443/gutterball",- ){
- file { "${foreman_plugins_dir}/foreman_gutterball.yaml":
I'd name this simply gutterball.yaml since foreman is implied.
—
Reply to this email directly or view it on GitHub
https://github.com/Katello/puppet-katello/pull/58/files#r24001396.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's also a good point. I'll think about this and get back to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @ehelms. the name of the plugin is foreman_gutterball
so the plugin's config file should have the same name.
aefb5e8
to
3d07b65
Compare
@ekohl, updated renamed the source template & destination config file |
3d07b65
to
ccaf98d
Compare
Ref #9134 - gb plugin sets configs for foreman-gutterball
merging! too much time spent on this 10 liner |
depends on Katello/puppet-gutterball#6