-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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 support for Tower Smart inventories #41458
Conversation
Add kind and host_filter fields and pass through to tower_cli.
The test
The test
The test
The test
The test
The test
|
@@ -102,7 +113,8 @@ def main(): | |||
|
|||
if state == 'present': | |||
result = inventory.modify(name=name, organization=org['id'], variables=variables, | |||
description=description, create_on_missing=True) | |||
description=description, kind=kind, host_filter=host_filter, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ryanpetrello do you think there may be any problems with past versions by passing kind & host_filter? I would say probably not, as long as the tower-cli version was up-to-date, it may send an extra field, but that would be ignored by the API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tested a Tower 3.1.x install to be sure, and it seems fine to me:
curl -sk "https://admin:pass@some-tower-3.1.6.amazonaws.com/api/v2/inventories/?kind=smart&host_filter=foo" | python -m json.tool
{
"count": 0,
"next": null,
"previous": null,
"results": []
}
@@ -37,6 +37,13 @@ | |||
variables: | |||
description: | |||
- Inventory variables. Use C(@) to get from file. | |||
kind: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These need version_added: "2.6"
values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added, thank you!
shipit |
1 similar comment
shipit |
* Support Smart Inventories Add kind and host_filter fields and pass through to tower_cli. * Add documentation for new Smart Inventories options * Add missing description header for host_filter documentation * Add version added tags to new options * Bumped vesion_added to 2.7
Hi,
|
@gundalow I think we've got a good handle on things ;) |
|
@jaevans thank you very much for taking the time to provide this feedback, it truly is useful. The CI errors for module documentation is a not something I'd considered before. Do you think a troubleshooting section on https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_documenting.html could help, ie list some of the common errors, detail how to fix them. |
SUMMARY
Add support for tower_inventory with kind smart. Fixes #41456
ISSUE TYPE
COMPONENT NAME
tower_inventory
ANSIBLE VERSION
ADDITIONAL INFORMATION
This simply adds support for the kind and host_filter parameters, which are passed to the tower_cli module.