ansible / awx-ee

An Ansible execution environment for AWX project
https://quay.io/ansible/awx-ee
Other
133 stars 156 forks source link

Can't load vmware module #95

Closed modzilla99 closed 2 years ago

modzilla99 commented 2 years ago

When running the latest quay.io/ansible/awx-ee image (latest and 0.6.0) , I am not able to execute the vmware module. It just won't load.

This is the playbook I'm using: modzilla99/windows-update

and this is the Error message:

fatal: [localhost -> localhost]: FAILED! => {
  "msg": "The module vmware_vm_info was redirected to community.vmware.vmware_vm_info, which could not be loaded."
}

The full log:

ansible-playbook [core 2.11.3.post0] 
  config file = None
  configured module search path = ['/home/runner/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.8/site-packages/ansible
  ansible collection location = /runner/requirements_collections:/home/runner/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible-playbook
  python version = 3.8.6 (default, Jan 29 2021, 17:38:16) [GCC 8.4.1 20200928 (Red Hat 8.4.1-1)]
  jinja version = 2.10.3
  libyaml = True
No config file found; using defaults
SSH password: 
Vault password: 
setting up inventory plugins
host_list declined parsing /runner/inventory/hosts as it did not pass its verify_file() method
Set default localhost to localhost
Parsed /runner/inventory/hosts inventory source with script plugin
redirecting (type: modules) ansible.builtin.win_shell to ansible.windows.win_shell
Loading collection ansible.windows from /usr/share/ansible/collections/ansible_collections/ansible/windows
redirecting (type: modules) ansible.builtin.vmware_guest_snapshot to community.vmware.vmware_guest_snapshot
Loading collection community.vmware from /usr/share/ansible/collections/ansible_collections/community/vmware
redirecting (type: modules) ansible.builtin.vmware_guest to community.vmware.vmware_guest
redirecting (type: modules) ansible.builtin.vmware_guest_snapshot to community.vmware.vmware_guest_snapshot
Loading callback plugin awx_display of type stdout, v2.0 from /usr/local/lib/python3.8/site-packages/ansible_runner/callbacks/awx_display.py
Skipping callback 'awx_display', as we already have a stdout callback.
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.

PLAYBOOK: main.yml *************************************************************
Positional arguments: main.yml
verbosity: 4
ask_pass: True
remote_user: svc-ansible@lab.loc
connection: smart
timeout: 10
become_method: sudo
tags: ('all',)
inventory: ('/runner/inventory/hosts',)
extra_vars: ('@/runner/env/extravars',)
ask_vault_pass: True
forks: 5
2 plays in main.yml

PLAY [Snapshot] ****************************************************************
META: ran handlers

TASK [vmware_snapshot : Gather Facts of all VMs in variable machines.] *********
task path: /runner/project/roles/vmware_snapshot/tasks/main.yml:2
Trying secret <ansible.parsing.vault.PromptVaultSecret object at 0x7f8f252f6280> for vault_id=default
Trying secret <ansible.parsing.vault.PromptVaultSecret object at 0x7f8f252f6280> for vault_id=default
Trying secret <ansible.parsing.vault.PromptVaultSecret object at 0x7f8f252f6280> for vault_id=default
Trying secret <ansible.parsing.vault.PromptVaultSecret object at 0x7f8f252f6280> for vault_id=default
Trying secret <ansible.parsing.vault.PromptVaultSecret object at 0x7f8f252f6280> for vault_id=default
Trying secret <ansible.parsing.vault.PromptVaultSecret object at 0x7f8f252f6280> for vault_id=default
Trying secret <ansible.parsing.vault.PromptVaultSecret object at 0x7f8f252f6280> for vault_id=default
Trying secret <ansible.parsing.vault.PromptVaultSecret object at 0x7f8f252f6280> for vault_id=default
skipping: [srv2022] => {
    "changed": false,
    "skip_reason": "Conditional result was False"
}
Trying secret <ansible.parsing.vault.PromptVaultSecret object at 0x7f8f252f6280> for vault_id=default
Trying secret <ansible.parsing.vault.PromptVaultSecret object at 0x7f8f252f6280> for vault_id=default
Trying secret <ansible.parsing.vault.PromptVaultSecret object at 0x7f8f252f6280> for vault_id=default
redirecting (type: modules) ansible.builtin.vmware_vm_info to community.vmware.vmware_vm_info
skipping: [srv2012r2] => {
    "changed": false,
    "skip_reason": "Conditional result was False"
}
skipping: [srv2019] => {
    "changed": false,
    "skip_reason": "Conditional result was False"
}
fatal: [localhost -> localhost]: FAILED! => {
    "msg": "The module vmware_vm_info was redirected to community.vmware.vmware_vm_info, which could not be loaded."
}
skipping: [srv2016] => {
    "changed": false,
    "skip_reason": "Conditional result was False"
}

TASK [vmware_snapshot : Create list of machines to snapshot] *******************
task path: /runner/project/roles/vmware_snapshot/tasks/main.yml:12
Trying secret <ansible.parsing.vault.PromptVaultSecret object at 0x7f8f252f6280> for vault_id=default
Trying secret <ansible.parsing.vault.PromptVaultSecret object at 0x7f8f252f6280> for vault_id=default
Trying secret <ansible.parsing.vault.PromptVaultSecret object at 0x7f8f252f6280> for vault_id=default
Trying secret <ansible.parsing.vault.PromptVaultSecret object at 0x7f8f252f6280> for vault_id=default
fatal: [srv2022]: FAILED! => {
    "msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'virtual_machines'\\n\\nThe error appears to be in '/runner/project/roles/vmware_snapshot/tasks/main.yml': line 12, column 3, but may\\nbe elsewhere in the file depending on the exact syntax problem.\\n\\nThe offending line appears to be:\\n\\n\\n- name: Create list of machines to snapshot\\n  ^ here\\n"
}
Trying secret <ansible.parsing.vault.PromptVaultSecret object at 0x7f8f252f6280> for vault_id=default
Trying secret <ansible.parsing.vault.PromptVaultSecret object at 0x7f8f252f6280> for vault_id=default
Trying secret <ansible.parsing.vault.PromptVaultSecret object at 0x7f8f252f6280> for vault_id=default
fatal: [srv2019]: FAILED! => {
    "msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'virtual_machines'\\n\\nThe error appears to be in '/runner/project/roles/vmware_snapshot/tasks/main.yml': line 12, column 3, but may\\nbe elsewhere in the file depending on the exact syntax problem.\\n\\nThe offending line appears to be:\\n\\n\\n- name: Create list of machines to snapshot\\n  ^ here\\n"
}
Trying secret <ansible.parsing.vault.PromptVaultSecret object at 0x7f8f252f6280> for vault_id=default
fatal: [srv2012r2]: FAILED! => {
    "msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'virtual_machines'\\n\\nThe error appears to be in '/runner/project/roles/vmware_snapshot/tasks/main.yml': line 12, column 3, but may\\nbe elsewhere in the file depending on the exact syntax problem.\\n\\nThe offending line appears to be:\\n\\n\\n- name: Create list of machines to snapshot\\n  ^ here\\n"
}
fatal: [srv2016]: FAILED! => {
    "msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'virtual_machines'\\n\\nThe error appears to be in '/runner/project/roles/vmware_snapshot/tasks/main.yml': line 12, column 3, but may\\nbe elsewhere in the file depending on the exact syntax problem.\\n\\nThe offending line appears to be:\\n\\n\\n- name: Create list of machines to snapshot\\n  ^ here\\n"
}

PLAY RECAP *********************************************************************
srv2012r2             : ok=0    changed=0    unreachable=0    failed=1    skipped=1    rescued=0    ignored=0   
srv2016               : ok=0    changed=0    unreachable=0    failed=1    skipped=1    rescued=0    ignored=0   
srv2019               : ok=0    changed=0    unreachable=0    failed=1    skipped=1    rescued=0    ignored=0   
srv2022               : ok=0    changed=0    unreachable=0    failed=1    skipped=1    rescued=0    ignored=0   
localhost                  : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   
AlanCoding commented 2 years ago

If you use the FQCN of community.vmware.vmware_vm_info, does the playbook work? That would tell us if there's a problem with redirection. Higher verbosity might give some more hints as well.

modzilla99 commented 2 years ago

Yeah that works! Even the next task that isn't changed to the fqcn starts to work for whatever reason. vmware_fqcn_test.log https://github.com/modzilla99/windows-update/tree/awx-ee-debug

AlanCoding commented 2 years ago

Could be a bug with Ansible core. I'll close this unless you have further problems.