Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

awx.awx.import returns Ok with no changes made. #15391

Open
5 of 11 tasks
itinneed2022 opened this issue Jul 22, 2024 · 1 comment
Open
5 of 11 tasks

awx.awx.import returns Ok with no changes made. #15391

itinneed2022 opened this issue Jul 22, 2024 · 1 comment

Comments

@itinneed2022
Copy link

Please confirm the following

  • I agree to follow this project's code of conduct.
  • I have checked the current issues for duplicates.
  • I understand that AWX is open source software provided for free and that I might not receive a timely response.
  • I am NOT reporting a (potential) security vulnerability. (These should be emailed to [email protected] 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
  • 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"

@djyasin
Copy link
Member

djyasin commented Jul 24, 2024

Hello @itinneed2022 the particular error you are encountering:
"msg": { "changed": false, "failed": false }

usually points to a configuration issue within the given playbook. Would you mind asking this on the Ansible Community Forum? A member of our community should be better able to assist you with this there.

Thank you for your time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants