awx.awx.inventory_source module – create, update, or destroy Automation Platform Controller inventory source.
Note
This module is part of the awx.awx collection (version 21.10.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install awx.awx
.
To use it in a playbook, specify: awx.awx.inventory_source
.
Synopsis
Create, update, or destroy Automation Platform Controller inventory source. See https://www.ansible.com/tower for an overview.
Parameters
Parameter |
Comments |
---|---|
Path to the controller config file. If provided, the other locations for config files will not be considered. |
|
URL to your Automation Platform Controller instance. If value not set, will try environment variable If value not specified by any means, the value of |
|
The OAuth token to use. This value can be in one of two formats. A string which is the token itself. (i.e. bqV5txm97wqJqtkxlMkhQz0pKhRMMX) A dictionary structure as returned by the token module. If value not set, will try environment variable |
|
Password for your controller instance. If value not set, will try environment variable |
|
Username for your controller instance. If value not set, will try environment variable |
|
Credential to use for the source. |
|
Local absolute file path containing a custom Python virtualenv to use. Only compatible with older versions of AWX/Controller Deprecated, will be removed in the future |
|
The description to use for the inventory source. |
|
Value when the host is considered enabled, e.g., “powered_on” |
|
The variable to use to determine enabled state e.g., “status.power_state” |
|
Execution Environment to use for the source. |
|
If specified, AWX will only import hosts that match this regular expression. |
|
Inventory the group should be made a member of. |
|
The name to use for the inventory source. |
|
A new name for this assets (will rename the asset) |
|
list of notifications to send on error |
|
list of notifications to send on start |
|
list of notifications to send on success |
|
Name of the inventory source’s inventory’s organization. |
|
Delete child groups and hosts not found in source. Choices:
|
|
Override vars in child groups and hosts with those from external source. Choices:
|
|
The source to use for this group. Choices:
|
|
For an SCM based inventory source, the source path points to the file within the repo to use as an inventory. |
|
Project to use as source with scm option |
|
The variables or environment fields to apply to this source type. |
|
Desired state of the resource. Choices:
|
|
The amount of time (in seconds) to run before the task is canceled. |
|
Time in seconds to consider an inventory sync to be current. |
|
Refresh inventory data from its source each time a job is run. Choices:
|
|
Whether to allow insecure connections to AWX. If This should only be used on personally controlled sites using self-signed certificates. If value not set, will try environment variable Choices:
|
|
The verbosity level to run this inventory source under. Choices:
|
Notes
Note
If no config_file is provided we will attempt to use the tower-cli library defaults to find your host information.
config_file should be in the following format host=hostname username=username password=password
Examples
- name: Add an inventory source
inventory_source:
name: "source-inventory"
description: Source for inventory
inventory: previously-created-inventory
credential: previously-created-credential
overwrite: True
update_on_launch: True
organization: Default
source_vars:
private: false