-
Notifications
You must be signed in to change notification settings - Fork 31
Systems nested hostgroups are only grouped by top-level hostgroup #27
Comments
On Fri, Aug 19, 2016 at 03:40:15AM -0700, Maxim Burgerhout wrote:
It will also create groups named RHEL7_Database_Production
You can achieve that using parameters on the hostgroups and |
Mmh. I must be doing something wrong then, because I only get the 'Production' one. |
If I create a nested hostgroup |
Hello, I am using foreman 1.13 and Ansible 2.1.0 Regards, |
On Mon, Oct 10, 2016 at 11:18:21PM -0700, Simon wrote:
Please tell us how you came to this conclusion so we can debug |
I came to this conclusion by executing the inventory script manually or called by ansible-playbook. In both situations I get the following groups: { But in foreman I have configured: datacenter/lan/distris-lan |
On Mon, Oct 10, 2016 at 11:24:13PM -0700, Simon wrote:
Hmmm...see my comment:
We're "simply" grabbing the hostgroup_name from the host object so maybe
If that's the case then there's a bug in Foreman itself. |
I don't recall such a change and just confirmed with 1.12. If you want to get the nested hierarchy, you need to use the
|
I've checked this and the following is returned by the API: "hostgroup_name":"distris-lan","hostgroup_title":"datacenter/lan/distris-lan" |
I have created this pull request: Pull Request #38 |
On Tue, Oct 11, 2016 at 12:03:10AM -0700, Timo Goebel wrote:
The 1.10 instance I had when writing the inventory hat _name == hostname_title |
That makes sense, the new parameter was added in 1.12.0, see http://projects.theforeman.org/issues/14190 |
Foreman changed behviour in 1.12: the hostgroup_name does no longer contain the parent hostgroups like " a / b / c " but the title does so use this for the building the ansible groups. Fall back to hostgroup_name for older versions. Closes: #27
Foreman changed behviour in 1.12: the hostgroup_name does no longer contain the parent hostgroups like " a / b / c " but the title does so use this for the building the ansible groups. Fall back to hostgroup_name for older versions. Closes #27
Foreman changed behviour in 1.12: the hostgroup_name does no longer contain the parent hostgroups like " a / b / c " but the title does so use this for the building the ansible groups. Fall back to hostgroup_name for older versions. Closes #27
@timogoebel Thanks for digging this out. I've added a PR that prefers title of name. |
Foreman changed behviour in 1.12: the hostgroup_name does no longer contain the parent hostgroups like " a / b / c " but the title does so use this for the building the ansible groups. Fall back to hostgroup_name for older versions. Closes #27
Please note that the release package download doesn't contain this fix. I had to clone from the repo to fix the issue, but a new release is probably needed. |
I have a hostgroup hierarchy like this: RHEL7/Webserver/Production. With the current script, I only get automatic grouping on "Production", which is ambiguous, since I might as well have RHEL7/Database/Production.
What would be great if the script could either group automatically on all nested hostgroups (group for RHEL7, Webserver / Database and Production), or on the whole hierarchy (automatic group in Ansible would be RHEL7/Webserver/Production).
The text was updated successfully, but these errors were encountered: