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

Ref #9134 - gb plugin sets configs for foreman-gutterball #58

Merged
merged 1 commit into from
Feb 4, 2015

Conversation

dustints
Copy link

@@ -0,0 +1,2 @@
<%# for foreman_gutterball plugin %>
:url: <%= @fqdn %>

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!

Copy link
Author

Choose a reason for hiding this comment

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

addressing

@ehelms
Copy link
Member

ehelms commented Jan 30, 2015

A more tpyical convention would be to create manifests/plugin/gutterball/config.pp and perhaps to mimic the same for templates to help with separation and locating things, e.g. templates/plugin/gutterball/foreman_gutterball.yaml.erb

class katello::plugin::foreman_gutterball_config(
$foreman_user = 'foreman',
$foreman_group = 'foreman',
$foreman_plugins_dir = '/usr/share/foreman/plugins',
Copy link
Member

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

@dustints dustints force-pushed the foreman_gutterball_config branch 2 times, most recently from c81439d to 324ed5a Compare February 2, 2015 05:14
@dustints
Copy link
Author

dustints commented Feb 2, 2015

@ehelms, @komidore64 , @ekohl
addressed commends.

  • template is now @ templates/plugin/gutterball/foreman_gutterball_addressable.yaml.erb
  • does not concat with the gem's settings into one config. instead it creates a new config in /usr/foreman..settings.plugin.d/foreman_gutterball_auxiliary.yaml

@@ -1,9 +1,26 @@
# gutterball plugin
class katello::plugin::gutterball{
$foreman_gutterball_gem_config_tmp = '/tmp/foreman_gutterball.yaml'

$package = "${foreman::plugin_prefix}gutterball"
Copy link
Member

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.

@dustints dustints force-pushed the foreman_gutterball_config branch 2 times, most recently from 6573d9f to b95683b Compare February 2, 2015 12:50
@dustints
Copy link
Author

dustints commented Feb 2, 2015

@ekohl updated.

$foreman_plugins_dir = '/etc/foreman/plugins',
){

file { "${foreman_plugins_dir}/foreman_gutterball_auxiliary.yaml":
Copy link
Member

Choose a reason for hiding this comment

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

Why 'auxiliary' ?

Copy link
Author

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?

Copy link
Member

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.

Copy link
Member

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.

@dustints
Copy link
Author

dustints commented Feb 2, 2015

@ehelms, @ekohl updated

  • rename foreman_gutterball_aux => foreman_gutterball_url.yaml
  • parameterize the url supplied in template.

@@ -0,0 +1,6 @@
:foreman_gutterball_url:
:protocol: <%= @protocol %>
Copy link
Member

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.

Copy link
Author

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?

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

@dustints dustints force-pushed the foreman_gutterball_config branch 2 times, most recently from ffd5a89 to e21bfb0 Compare February 2, 2015 17:22
@dustints
Copy link
Author

dustints commented Feb 2, 2015

@komidore64, @ehelms, @ekohl
updated

  • just using the same format as katello's config for url
  • let this module manage foreman_gutterball.yaml so renaming templates and destination config file to foreman_gutterball.yaml

$foreman_plugins_dir = '/etc/foreman/plugins',
$protocol = 'https',
$port = '8443',
$path = 'gutterball/',
Copy link
Member

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.

@dustints
Copy link
Author

dustints commented Feb 2, 2015

@ehelms updated

@ehelms
Copy link
Member

ehelms commented Feb 2, 2015

APT

@@ -0,0 +1,2 @@
:foreman_gutterball:
:url: <%= @protocol %>://<%= @fqdn %>:<%= @port %><%= @path %>

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 %>

@dustints dustints force-pushed the foreman_gutterball_config branch 2 times, most recently from 5b3e5ae to 11b15d4 Compare February 2, 2015 18:30
@dustints
Copy link
Author

dustints commented Feb 2, 2015

@komidore64 updated

@komidore64
Copy link

awesome!

ack pending tests

$foreman_user = 'foreman',
$foreman_group = 'foreman',
$foreman_plugins_dir = '/etc/foreman/plugins',
$protocol = 'https',
Copy link
Member

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.

@dustints
Copy link
Author

dustints commented Feb 3, 2015

@ekohl updated to a single url param

$url = "https://${fqdn}:8443/gutterball",
){

file { "${foreman_plugins_dir}/foreman_gutterball.yaml":
Copy link
Member

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.

Copy link
Member

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.

Copy link
Member

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.

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.

@dustints
Copy link
Author

dustints commented Feb 3, 2015

@ekohl, updated renamed the source template & destination config file

dustints pushed a commit that referenced this pull request Feb 4, 2015
Ref #9134 - gb plugin sets configs for foreman-gutterball
@dustints dustints merged commit b0d65ee into theforeman:master Feb 4, 2015
@dustints
Copy link
Author

dustints commented Feb 4, 2015

merging! too much time spent on this 10 liner

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.

None yet

4 participants