New in version 2.7.
The below requirements are needed on the host that executes this module.
Parameter | Choices/Defaults | Comments |
---|---|---|
credential - | Credential to use to retrieve the inventory from. | |
description - | The description to use for the inventory source. | |
group_by - | Specify which groups to create automatically. Group names will be created similar to the options selected. If blank, all groups above are created. Refer to Ansible Tower documentation for more detail. | |
instance_filters - | Provide a comma-separated list of filter expressions. Hosts are imported when all of the filters match. Refer to Ansible Tower documentation for more detail. | |
inventory - / required | The inventory the source is linked to. | |
name - / required | The name to use for the inventory source. | |
overwrite boolean |
| If set, any hosts and groups that were previously present on the external source but are now removed will be removed from the Tower inventory. Hosts and groups that were not managed by the inventory source will be promoted to the next manually created group or if there is no manually created group to promote them into, they will be left in the "all" default group for the inventory. When not checked, local child hosts and groups not found on the external source will remain untouched by the inventory update process. |
overwrite_vars boolean |
| If set, all variables for child groups and hosts will be removed and replaced by those found on the external source. When not checked, a merge will be performed, combining local variables with those found on the external source. |
source - / required |
| Types of inventory source. |
source_path - | Path to the file to use as a source in the selected *project*. | |
source_project - | Use a *project* as a source for the *inventory*. | |
source_regions - | List of regions for your cloud provider. You can include multiple all regions. Only Hosts associated with the selected regions will be updated. Refer to Ansible Tower documentation for more detail. | |
source_script - | The source custom script to use to build the inventory. It needs to exist. | |
source_vars - | The source_vars allow to Override variables found in the source config file. For example with Openstack, specifying *private: false* would change the output of the openstack.py script. It has to be YAML or JSON. | |
state - |
| Desired state of the resource. |
timeout - | Number in seconds after which the Tower API methods will time out. | |
tower_config_file path | Path to the Tower config file. | |
tower_host string | URL to your Tower instance. | |
tower_password string | Password for your Tower instance. | |
tower_username string | Username for your Tower instance. | |
update_cache_timeout - | Time in seconds to consider an inventory sync to be current. During job runs and callbacks the task system will evaluate the timestamp of the latest sync. If it is older than Cache Timeout, it is not considered current, and a new inventory sync will be performed. | |
update_on_launch boolean |
| Each time a job runs using this inventory, refresh the inventory from the selected source before executing job tasks. |
update_on_project_update boolean |
| That parameter will sync the inventory when the project is synced. It can only be used with a SCM source. |
validate_certs boolean |
| Tower option to avoid certificates check. aliases: tower_verify_ssl |
Note
- name: Add tower inventory source tower_inventory_source: name: Inventory source description: My Inventory source inventory: My inventory credential: Devstack_credential source: openstack update_on_launch: true overwrite: true source_vars: '{ private: false }' state: present validate_certs: false
Hint
If you notice any issues in this documentation, you can edit this document to improve it.
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.9/modules/tower_inventory_source_module.html