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

Fixes #30078 - add parameter to accept a hostgroup config hash #863

Merged
merged 1 commit into from
Jul 30, 2020

Conversation

apatelKmd
Copy link

No description provided.

templates/default_hostgroup.yaml.erb Outdated Show resolved Hide resolved
manifests/plugin/default_hostgroup.pp Outdated Show resolved Hide resolved
manifests/plugin/default_hostgroup.pp Outdated Show resolved Hide resolved
manifests/plugin/default_hostgroup.pp Outdated Show resolved Hide resolved
@ekohl ekohl changed the title Fixes #30078 add parameter to accept a hostgroup config hash Fixes #30078 - add parameter to accept a hostgroup config hash Jun 25, 2020
@ekohl
Copy link
Member

ekohl commented Jun 25, 2020

Would you mind squashing the commits? Also use Fixes #30078 - <message>. Looks like now the check doesn't detect it.

@apatelKmd apatelKmd force-pushed the master branch 2 times, most recently from b114dba to c522a74 Compare June 25, 2020 18:09
@apatelKmd
Copy link
Author

I want to know how can I use the parameter with multiple hashes. For e.g, I want to add the same parameters as described in the spec test. Can you help with it?

foreman-installer --foreman-plugin-default-hostgroup-hostgroups ???

@ekohl
Copy link
Member

ekohl commented Jun 29, 2020

kafo is the engine behind exposing parameters. In particular https://github.com/theforeman/kafo#hash-arguments is relevant. However, I don't know how it would deal with a hash inside a hash. I think there's even a bug in that --param=key:value doesn't work and needs to be --param key:value. Perhaps --param key:nested_key:value works. Otherwise that might be a possible RFE.

Another solution is to put it in custom-hiera.yaml. This is not really what we want (answers for exposed classes should be preferred), but if it's the only way, it has to be that way. Then you would use (from the top of my head):

foreman::plugin::default_hostgroup::hostgroups:
  key:
    nested_key: value

@apatelKmd
Copy link
Author

Thanks @ekohl for clarifying the use of the parameter. Use of custom-hiera.yaml will do. What version of the foreman-installer will include the update? If we know the future plan we can prepare our installer arguments accordingly.

@ekohl
Copy link
Member

ekohl commented Jun 29, 2020

At this moment we're in the Foreman 2.2 development cycle. If it's merged in the next few weeks, that'll be the version to contain it.

@apatelKmd
Copy link
Author

@ekohl AFAIK, the changes are complete. Please let me know if you want me to make an update?

manifests/plugin/default_hostgroup.pp Outdated Show resolved Hide resolved
manifests/plugin/default_hostgroup.pp Outdated Show resolved Hide resolved
@apatelKmd
Copy link
Author

@ekohl I have incorporated your suggestions followed by squash and rebase.

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

Overall 👍, just a last small whitespace note.

spec/classes/plugin/default_hostgroup_spec.rb Outdated Show resolved Hide resolved
Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

Right now the tests are still running, but other than that this can be merged.

@apatelKmd
Copy link
Author

Lint test failed, I pushed an update to resolve the issue.

@apatelKmd apatelKmd closed this Jul 29, 2020
@apatelKmd apatelKmd reopened this Jul 29, 2020
@ekohl ekohl merged commit 8e4c89a into theforeman:master Jul 30, 2020
@ekohl
Copy link
Member

ekohl commented Jul 30, 2020

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants