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

Add option to use Foreman config groups to set Ansible groups #55508

Open
wants to merge 1 commit into
base: devel
from

Conversation

Projects
None yet
3 participants
@milliams
Copy link
Contributor

commented Apr 18, 2019

SUMMARY

Foreman has the ability to set "config groups" on hosts. Unlike Foreman's "host groups", you can have multiple config groups assigned to a host, basically allowing host tagging. This PR adds the ability to set Ansible inventory groups based on these config groups. Config groups were added to Foreman for assigning Puppet classes so we'd be using them for a similar purpose.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

Foreman inventory plugin

@@ -232,6 +247,14 @@ def _populate(self):
if self.get_option('want_facts'):
self.inventory.set_variable(host['name'], 'ansible_facts', self._get_facts(host))

# set Ansible groups from Foreman config groups
if self.get_option('use_config_groups'):

This comment has been minimized.

Copy link
@bcoca

bcoca Apr 18, 2019

Member

instead of adding them directly why not expose as a variable and let user decide if they want to create groups based on it in 'compose'?

@ansibot ansibot added the stale_ci label Apr 26, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.