robertdebock / ansible-role-bootstrap

Prepare your system to be managed by Ansible.
https://robertdebock.nl/
Apache License 2.0
199 stars 58 forks source link

Unable to bootstrap Ubuntu hirsute #55

Closed MLNW closed 1 year ago

MLNW commented 2 years ago

Describe the bug

When applying this role to the docker.io/ubuntu:hirsute image it fails upon installing bootstrap packages.

When I login to the container after molecule converge has failed and execute the command myself it works without issue.

mol converge # Fails with ...
...
TASK [robertdebock.bootstrap : install bootstrap packages (raw)] ***************
fatal: [instance]: FAILED! => {"changed": true, "msg": "non-zero return code", "rc": 127, "stderr": "Error: exec failed: container_linux.go:380: starting container process caused: exec: \"LANG=C\": executable file not found in $PATH: OCI not found\n", "stderr_lines": ["Error: exec failed: container_linux.go:380: starting container process caused: exec: \"LANG=C\": executable file not found in $PATH: OCI not found"], "stdout": "", "stdout_lines": []}
...
mol login
LANG=C apt-get update && apt-get install -y python3 sudo gnupg python3-apt # Succeeds
CTRL+D
mol converge # Succeeds

Playbook

---
- name: Prepare machine for role usage
  hosts: all
  become: true
  gather_facts: false
  roles:
    - robertdebock.bootstrap

Molecule configuration

---
dependency:
  name: galaxy
driver:
  name: podman
platforms:
  - name: instance
    image: docker.io/ubuntu:hirsute
    pre_build_image: true
provisioner:
  name: ansible
verifier:
  name: ansible

Environment

castorsky commented 1 year ago

Hello! I have got this issue when tried to use the role in podman containers on the openSUSE host. And changes proposed by Jonas helped me - packages are now being installed inside containers.

robertdebock commented 1 year ago

Thanks, fixed by latest release.