# Ansible.controller.import returns OK

**URL:** <https://forum.ansible.com/t/ansible-controller-import-returns-ok/7852>\
**Category:** Get Help\
**Tags:** collections\
**Created:** [August 14, 2024, 6:26pm UTC](https://forum.ansible.com/t/ansible-controller-import-returns-ok/7852 "2024-08-14T18:26:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![itineed2022](https://avatars.discourse-cdn.com/v4/letter/i/47e85d/32.png) [@itineed2022](https://forum.ansible.com/u/itineed2022)\
**Post date:** [August 14, 2024, 6:26pm UTC](https://forum.ansible.com/t/ansible-controller-import-returns-ok/7852/1 "2024-08-14T18:26:57Z")

</div>

When running an import, I receive a response of OK, even if I changed the assets from an export.

```auto
# ansible-playbook /Users/me/Documents/Ansible/AnsibleAutomation_platform/import_workflow.yaml -vvv
---
- name: Import Workflow
  hosts: localhost
  connection: local
  gather_facts: false
  collections:
    - ansible.controller
  environment:
     CONTROLLER_HOST: https://my.company.com/
     CONTROLLER_USERNAME: api_user
     CONTROLLER_PASSWORD: redacted
     CONTROLLER_VERIFY_SSL: False
  tasks:
  - debug:
      msg: "Starting Import"
  - name: Import workflow job template
    ansible.controller.import:
      assets: "{{ lookup('file', 'workflow.yaml') | from_yaml }}"
    register: import_results
  - debug:
      msg: "{{ import_results }}"

```

Result:

```auto
TASK [debug] ********************************************************************************************************************************************************************
task path: /Users/me/Documents/Ansible/AnsibleAutomation_platform/import_workflow.yaml:21
ok: [localhost] => {
    "msg": {
        "changed": false,
        "failed": false
    }
}

PLAY RECAP **********************************************************************************************************************************************************************
localhost : ok=3 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0   

```

Here’s what I used to get the values for the workflow.yaml file:

```auto
ansible-playbook /Users/me/Documents/Ansible/AnsibleAutomation_platform/export_job_templates.yaml -e "password=CHANGEME job_template=all" -vvv
---
- name: Export Workflow
  hosts: localhost
  connection: local
  gather_facts: false
  collections:
    - ansible.controller
  environment:
     CONTROLLER_HOST: https://my.company.com/
     CONTROLLER_USERNAME: api_user
     CONTROLLER_PASSWORD: "{{ password }}"
     CONTROLLER_VERIFY_SSL: False
  tasks:
  - debug:
      msg: "Starting Export"
  - name: Export workflow job template
    ansible.controller.export:
      job_templates: "{{ job_templates }}"
    register: export_results
  - debug:
      var: export_results
  - name: Export job template to file
    copy:
      content: "{{ export_results | to_nice_yaml( width=50, explicit_start=True, explicit_end=True) }}"
      dest: "workflow.yaml"

```

---

<div class="post-metadata">

**Author:** ![Klaas](https://avatars.discourse-cdn.com/v4/letter/k/ecc23a/32.png) [@Klaas](https://forum.ansible.com/u/Klaas)\
**Post date:** [August 15, 2024, 8:36am UTC](https://forum.ansible.com/t/ansible-controller-import-returns-ok/7852/2 "2024-08-15T08:36:24Z")

</div>

I am guessing you need to open a support request with Red Hat or test it against awx and the awx.awx collection 🙂

---

<div class="post-metadata">

**Author:** ![itineed2022](https://avatars.discourse-cdn.com/v4/letter/i/47e85d/32.png) [@itineed2022](https://forum.ansible.com/u/itineed2022)\
**Post date:** [August 15, 2024, 12:40pm UTC](https://forum.ansible.com/t/ansible-controller-import-returns-ok/7852/3 "2024-08-15T12:40:59Z")

</div>

Tried that. Red Hat said to use their collection. Same difference.  
awx try:

```auto
---
- name: Export Job Templates
  hosts: localhost
  connection: local
  gather_facts: false
  collections:
    - awx.awx
  environment:
     CONTROLLER_HOST: https://my.company.com/
     CONTROLLER_USERNAME: api_user
     CONTROLLER_PASSWORD: 
     CONTROLLER_VERIFY_SSL: False
  tasks:
  - debug:
      msg: "Starting Export"
  - name: Export workflow job template
    awx.awx.export:
      job_templates: '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: template.yaml

```

I had tried awx before:

> <https://github.com/ansible/awx/issues/15391>
>
> \### Please confirm the following
> 
> \- \[X\] I agree to follow this project's \[code o…f conduct\](https://docs.ansible.com/ansible/latest/community/code\_of\_conduct.html).
> \- \[X\] I have checked the \[current issues\](https://github.com/ansible/awx/issues) for duplicates.
> \- \[X\] I understand that AWX is open source software provided for free and that I might not receive a timely response.
> \- \[X\] I am \*\*NOT\*\* reporting a (potential) security vulnerability. (These should be emailed to \`security@ansible.com\` instead.)
> 
> \### Bug Summary
> 
> When running awx.awx.import, play returns "Ok" with no changes made but the inventory contained changes.
> 
> \### AWX version
> 
> 24.6.1
> 
> \### Select the relevant components
> 
> \- \[\] UI
> \- \[\] UI (tech preview)
> \- \[\] API
> \- \[\] Docs
> \- \[\] Collection
> \- \[X\] CLI
> \- \[\] Other
> 
> \### Installation method
> 
> N/A
> 
> \### Modifications
> 
> no
> 
> \### Ansible version
> 
> ansible-galaxy \[core 2.15.12\]
> 
> \### Operating system
> 
> Mac OSX
> 
> \### Web browser
> 
> \_No response\_
> 
> \### Steps to reproduce
> 
> Run this playbook:
> \`\`\`
> \# ansible-playbook /Users/me/Documents/Ansible/AnsibleAutomation\_platform/import\_workflow.yaml -vvv
> \---
> \- name: Import Workflow
> hosts: localhost
> connection: local
> gather\_facts: false
> collections:
> - awx.awx
> environment:
> CONTROLLER\_HOST: https://my.company.com/
> CONTROLLER\_USERNAME: api\_user
> CONTROLLER\_PASSWORD: redacted
> CONTROLLER\_VERIFY\_SSL: False
> tasks:
> - debug:
> msg: "Starting Import"
> - name: Import workflow job template
> awx.awx.import:
> assets: "{{ lookup('file', 'workflow.yaml') | from\_yaml }}"
> register: import\_results
> - debug:
> msg: "{{ import\_results }}"
> \`\`\`
> 
> 
> \### Expected results
> 
> \`localhost : ok=0 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0\`
> 
> \### Actual results
> 
> \`\`\`
> TASK \[debug\] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
> task path: /Users/me/Documents/Ansible/AnsibleAutomation\_platform/import\_workflow.yaml:21
> ok: \[localhost\] =\> {
> "msg": {
> "changed": false,
> "failed": false
> }
> }
> 
> PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
> localhost : ok=3 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0   
> 
> \`\`\`
> 
> \### Additional information
> 
> I created the inventory using the awx.awx.export module. Here is that playbook:
> \`\`\`
> \# ansible-playbook /Users/me/Documents/Ansible/AnsibleAutomation\_platform/export\_workflow.yaml -vvv
> \---
> \- name: Export Workflow
> hosts: localhost
> connection: local
> gather\_facts: false
> collections:
> - awx.awx
> environment:
> CONTROLLER\_HOST: https://my.company.com/
> CONTROLLER\_USERNAME: api\_user
> CONTROLLER\_PASSWORD: redacted
> CONTROLLER\_VERIFY\_SSL: False
> tasks:
> - debug:
> msg: "Starting Export"
> - name: Export workflow job template
> awx.awx.export:
> workflow\_job\_templates: '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
> \`\`\`
> 
> The change I made to the workflow.yaml file was a very simple one. Just changing a name and adding a description to one of the workflow templates. It should return as Changed but instead its just "Ok"

But they said to post here. So since Red Hat’s been quite I thought I’d give this forum a try.
