I had asked this question on the awx github but they cannot reproduce it.
Bug Summary
awx.awx.export returns:
TASK [Export workflow job template] ******************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {“changed”: false, “msg”: “Unsupported parameters for (awx.awx.export) module: credentials, job_templates. Supported parameters include: controller_password (tower_password), request_timeout, controller_host (tower_host), controller_oauthtoken (tower_oauthtoken), all, validate_certs (tower_verify_ssl), controller_username (tower_username), controller_config_file (tower_config_file).”}
The job_templates option should be available according to:
https://galaxy.ansible.com/ui/repo/published/awx/awx/content/module/export/?extIdCarryOver=true&sc_cid=701f2000001OH7YAAW
AWX version
awxkit 24.6.1
Select the relevant components
- UI
- UI (tech preview)
- API
- Docs
- Collection
- CLI
- Other
Installation method
N/A
Modifications
no
Ansible version
2.13.2
Operating system
MacOS Sonoma 14.5
Web browser
Firefox
Steps to reproduce
ansible-playbook /Users/myself/Documents/Ansible/AnsibleAutomation_platform_rebuild/export_workflow.yaml
Expected results
PLAY RECAP *******************************************************************************************************************************************************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
Actual results
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
PLAY [Export Workflow] *******************************************************************************************************************************************************************************************
TASK [Export workflow job template] ******************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Unsupported parameters for (awx.awx.export) module: credentials, job_templates. Supported parameters include: controller_password (tower_password), request_timeout, controller_host (tower_host), controller_oauthtoken (tower_oauthtoken), all, validate_certs (tower_verify_ssl), controller_username (tower_username), controller_config_file (tower_config_file)."}
PLAY RECAP *******************************************************************************************************************************************************************************************************
localhost : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
Additional information
python3 -m pip install awxkit
Requirement already satisfied: awxkit in /opt/homebrew/lib/python3.10/site-packages (24.6.1)
Requirement already satisfied: PyYAML in /opt/homebrew/lib/python3.10/site-packages (from awxkit) (6.0.1)
Requirement already satisfied: setuptools in /opt/homebrew/lib/python3.10/site-packages (from awxkit) (59.6.0)
Requirement already satisfied: requests in /opt/homebrew/lib/python3.10/site-packages (from awxkit) (2.32.3)
Requirement already satisfied: charset-normalizer<4,>=2 in /opt/homebrew/lib/python3.10/site-packages (from requests->awxkit) (3.3.2)
Requirement already satisfied: urllib3<3,>=1.21.1 in /opt/homebrew/lib/python3.10/site-packages (from requests->awxkit) (2.2.2)
Requirement already satisfied: idna<4,>=2.5 in /opt/homebrew/lib/python3.10/site-packages (from requests->awxkit) (3.7)
Requirement already satisfied: certifi>=2017.4.17 in /opt/homebrew/lib/python3.10/site-packages (from requests->awxkit) (2024.7.4)
Also the playbook:
---
- name: Export Workflow
hosts: localhost
connection: local
gather_facts: false
collections:
- awx.awx
environment:
CONTROLLER_HOST: https://ansibleautomation.mycompany.com/
CONTROLLER_USERNAME: me2500
CONTROLLER_PASSWORD: redacted
CONTROLLER_VERIFY_SSL: False
tasks:
- name: Export workflow job template
awx.awx.export:
job_templates: "Server Decom - 1"
credentials: 'all'
register: export_results
- debug:
var: export_results
- name: Export workflow job template to file
copy:
content: "{{ export_results | to_nice_yaml( width=50, explicit_start=True, explicit_end=True) }}"
dest: workflow.yaml