Using awx.awx.export module

, ,

I have create a playbook to export specific job templates & work flow templates as well as a custom EE.

The playbook seems to work successfully, I however have no idea where the exports actually get saved?

Can someone please tell me where I can find those as I would like to import them into a customers Ansible Automation Platform 2 solution (Ansible Tower), instead of recreating it all again.

Thanks in advance

Still not been able to find where the export is saved? Any ideas, or am i using the module incorrectly?

  • name: “netbox testing prefixes”
    connection: local
    hosts: localhost
    gather_facts: False

tasks:

  • name: Export a job template named “My Template” and all Credentials
    awx.awx.export:
    controller_username: admin
    controller_password: ********
    controller_host: http://10...**:31189
    validate_certs: false

Hi!

awx.awx.export doesn’t save results explicitly, but you can register the output and save it to disk using the copy module, something like

tasks:

  • name: Export all assets
    awx.awx.export:
    job_templates: ‘all’
    projects: ‘all’
    all: True
    register: export_output

  • name: Save export to file
    copy:
    content: “{{ export_output[‘assets’] }}”
    dest: export.json

Let me know if that is helpful!
Seth