-
Notifications
You must be signed in to change notification settings - Fork 467
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
support for ad-hoc groups created by the group_by module #201
Comments
Does the output of the following command include your ad-hoc groups?
If so, I'm thinking about rewriting the custom inventory parsing in ansible-cmdb to use the output of that command. |
Various local custom facts and other nice vars are in the output of that command. Here some of my custom facts in the output: "ansible_local": {
"custom": {
"country": "za",
"datacenter": "b1",
"dmz": "untrusted"
} So we have a task something like this in our code: - name: FACTS | Classify hosts depending on their OS distribution and version
group_by:
key: os_{{ ansible_facts['distribution'] }}{{ ansible_facts['distribution_major_version'] }}
tags: facts
- name: FACTS | Classify hosts depending on their country
group_by:
key: country_{{ ansible_facts['ansible_local']['custom']['country'] }}
tags: facts This would create an ad-hoc group like It seems this data is not in the |
There's an open PR (#215) that replaces the custom fact parser with ansible's default parser. I'm hoping this feature will be supported out of the box when I merge that PR. I'll keep this issue open for now. |
Thanks for this great software.
We use group_by ansible module to create ad-hoc groups based on our custom facts. This creates ad-hoc groups like env_dev env_prod , os_el6 etc.
Is there is a way to get these groups to be detected in ansible-cmdb?
The text was updated successfully, but these errors were encountered: