ansible / awx-ee

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

gather_facts fails #52

Closed alexandru-bagu closed 3 years ago

alexandru-bagu commented 3 years ago

No matter what tasks I attempt I always get a vague "sudo: command not found" error. I tested both EE devel and 0.1.1 via AWX Ansible 19.0.0. I also tried with a registered host in AWX as a local host with 127.0.0.1 ip, same result.

My playbook is this:

---
- name: Test
  hosts: localhost
  gather_facts: True

  tasks:
    - name: Test
      debug:
        msg: "This is a test"

Example of result:

{
  "ansible_facts": {},
  "msg": "The following modules failed to execute: ansible.legacy.setup\n",
  "failed_modules": {
    "ansible.legacy.setup": {
      "failed": true,
      "module_stdout": "",
      "module_stderr": "/bin/sh: sudo: command not found\n",
      "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
      "rc": 127
    }
  },
  "_ansible_verbose_override": true,
  "_ansible_no_log": false,
  "changed": false
}

Full recap:

[WARNING]: provided hosts list is empty, only localhost is available. Note that
the implicit localhost does not match 'all'
PLAY [Test] ********************************************************************
TASK [Gathering Facts] *********************************************************
fatal: [localhost]: FAILED! => {"ansible_facts": {}, "changed": false, "failed_modules": {"ansible.legacy.setup": {"failed": true, "module_stderr": "/bin/sh: sudo: command not found\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 127}}, "msg": "The following modules failed to execute: ansible.legacy.setup\n"}
PLAY RECAP *********************************************************************
localhost                  : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   
shanemcd commented 3 years ago

sudo: command not found - what you are trying to do won't work. In general, you don't want to use sudo inside of a container.

sahil100122 commented 2 years ago

@shanemcd There is no presence of sudo in the playbook in any manner. I am facing the same issue when i am trying to update my inventory through SCM. Same error pops up.

nicolasStevenin commented 1 year ago

Hi, probably too late but I think this option is activated in your AWX template image

lauren-zaden commented 2 months ago

I'm facing the same issue with my playbook when running in gitlab pipeline. Has anyone found a resolution to the error?