Using awx.awx.export module

1,191 views
Skip to first unread message

alber...@gmail.com

unread,
Mar 16, 2022, 12:52:20 PM3/16/22
to AWX Project
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

alber...@gmail.com

unread,
Apr 19, 2022, 4:22:35 PM4/19/22
to AWX Project
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
        ############
        job_templates: "ThorAshore_aci_ap"
   

Seth Foster

unread,
Apr 20, 2022, 3:26:11 PM4/20/22
to AWX Project
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
Reply all
Reply to author
Forward
0 new messages