ansible / ansible-dev-tools

Ansible automation developer tools
https://ansible.readthedocs.io/projects/dev-tools/
GNU General Public License v3.0
69 stars 26 forks source link

Container image v24.9.0: uid 1000 is missing from /etc/passwd #381

Open marshallford opened 1 week ago

marshallford commented 1 week ago

Hello 👋🏼,

I maintain a Terraform provider for Ansible which executes ansible-navigator run commands using the ansible-dev-tools container image as the default EEI. Anyways, while running the project's acceptance tests locally using version 24.9.0 of the container image I bumped into what I suspect might be a regression involving this change: https://github.com/ansible/ansible-dev-tools/pull/364. See below for the bug report. Lastly, one more detail which confuses me: I opened a PR against said Terraform provider project to run the acceptance tests in CI with the container image change. To my surprise, the tests all pass (including those which fail on my local dev machine as described below). Perhaps it has to do with the user id or container engine that GitHub runners have setup?

Thank you!

Host OS: Linux Host user (id -u): 1000 Ansible navigator version: 24.9.0 Container engine version (Docker): 27.2.1 Container image: ghcr.io/ansible/community-ansible-dev-tools:v24.9.0

Error:

EP_WARN: uid 1000 is missing from /etc/passwd, which is not writable; this error is likely fatal

PLAY [all] ********************************************************************* 
TASK [Gathering Facts] *********************************************************
fatal: [test]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: No user exists for uid 1000", "unreachable": true}

PLAY RECAP *********************************************************************
test                       : ok=0    changed=0    unreachable=1    failed=0    skipped=0    rescued=0    ignored=0   

Inventory:

"all":
  "hosts":
    "test":
      "ansible_host": "some.host.name"
      "ansible_user": "ubuntu"

Config:

ansible-navigator:
    ansible-runner:
        timeout: 600
    execution-environment:
        container-engine: auto
        enabled: true
        image: ghcr.io/ansible/community-ansible-dev-tools:v24.9.0
    logging:
        level: debug
    mode: stdout
    playbook-artifact:
        enable: true
    time-zone: UTC

Command:

ansible-navigator run playbook.yaml --inventory inventory --playbook-artifact-save-as playbook-artifact.json --log-file ansible-navigator.log