Ansible Tower
Configure and use the OneFuse Ansible Tower module with Red Hat Ansible
2 minute read
To learn more about this OneFuse module, refer to Ansible Tower.
Prerequisites
- Configure OneFuse Manager
- Review an overview on OneFuse Modules with OneFuse Ansible Module
Ansible OneFuse Module name
- Ansible OneFuse Module name for this OneFuse Module is:
ansible_tower
present
Run Provisioning Job Template(s) configured on the OneFuse Ansible Tower Policy.
Sample Play
- name: OneFuse Ansible Tower - present
hosts: localhost
gather_facts: false
vars:
policy_name: <REPLACEME_with_OneFusePolicyName>
tasks:
- name: Run Ansible Tower Provisioning Job Template(s)
onefuse:
module: ansible_tower
state: present
policy_name: '{{ policy_name }}'
limit: ''
hosts: ''
template_properties: {}
tracking_id: '{{ tracking_id | default(omit) }}'
delegate_to: localhost
register: output
- name: Output Results
debug:
msg: '{{ output }}'
- name: "Ansible Tower Outputs to workflow"
set_stats:
data:
onefuse_ansible_tower: '{{ onefuse_ansible_tower }}'
tracking_id: '{{ tracking_id }}'
Parameter references
The following defines the function of each Ansible Tower specific Task Parameters for onefuse.
| Parameter Name | Required? | Notes |
|---|---|---|
module |
Required | OneFuse Module Name (string). (Refer to Module names for OneFuse modules.) |
state |
Required | present for provision, or the appropriate “update” state for the OneFuse Module. |
policy_name |
Required | OneFuse Module Policy Name (string). |
template_properties |
Optional | Additional properties that are referenced within the Policy. Python dict format. |
tracking_id |
Optional | Tracking ID (string) to link multiple OneFuse Policy Executions and resulting OneFuse Managed Objects together. If none is passed, one gets generated by OneFuse for that specific Policy Execution. |
Ansible Tower specific parameters:
| Parameter Name | Required? | Notes |
|---|---|---|
hosts |
Optional | List of specific hosts to execute against. Similar to limit, but will match against exact hostnames. |
limit |
Optional | Ansible Tower Policy Limit. Pattern matches hosts. For example, dev-* will match all hosts that start with “dev-”. |
absent
Run Deprovisioning Job Template(s), if configured on the OneFuse Ansible Tower Policy.
Sample Play
- name: OneFuse Ansible Tower - absent
hosts: '{{ ansible_hosts }}'
gather_facts: false
tasks:
- name: Run Ansible Tower Deprovisioning Job Template(s)
onefuse:
module: ansible_tower
state: absent
object_name: '{{ onefuse_ansible.id | default(omit) }}'
delegate_to: localhost
register: output
- name: Output Results
debug:
msg: '{{ output }}'
Parameter references
The following defines the function of the Task Parameters for onefuse.
| Parameter Name | Required? | Notes |
|---|---|---|
module |
Required | OneFuse Module Name (string). (Refer to Module names for OneFuse modules.) |
state |
Required | absent for deprovision. |
object_name |
Required | OneFuse Managed Object ID (string). |