ansible / receptor-collection

Apache License 2.0
13 stars 15 forks source link

Support for Debian 12 #63

Open fosterseth opened 8 months ago

fosterseth commented 8 months ago

installing python packages throws the following error when running the collection against a Debian 12 instance.

Maybe we can just pass in --break-system-packages as an extra param in the pip module

TASK [ansible.receptor.setup : Install additional python packages] ***************************************************************************************************************************************************************************
fatal: [remote-execution]: FAILED! => {"changed": false, "cmd": ["/usr/bin/pip3", "install", "ansible-runner", "receptorctl"], "msg": "\n:stderr: error: externally-managed-environment\n\n× This environment is externally managed\n╰─> To install Python packages system-wide, try apt install\n    python3-xyz, where xyz is the package you are trying to\n    install.\n    \n    If you wish to install a non-Debian-packaged Python package,\n    create a virtual environment using python3 -m venv path/to/venv.\n    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make\n    sure you have python3-full installed.\n    \n    If you wish to install a non-Debian packaged Python application,\n    it may be easiest to use pipx install xyz, which will manage a\n    virtual environment for you. Make sure you have pipx installed.\n    \n    See /usr/share/doc/python3.11/README.venv for more information.\n\nnote: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.\nhint: See PEP 668 for the detailed specification.\n"}
DavidCoy77 commented 8 months ago

Hello, I'm an undergraduate programming student who's looking to make a first-time contribution to GitHub. I see you have this issue marked as "good first issue", so if you're willing to offer some guidance I'd love to get started!

fosterseth commented 8 months ago
  1. install molecule https://ansible.readthedocs.io/projects/molecule/installation/
  2. checkout receptor-collection from github
  3. cd to directory
  4. change debian:11 to debian:12 in molecule.yml and Containerfile.j2
  5. run `molecule test -p molecule-debian

right now debian container isn't starting, not sure why. So getting that working would be a start

TASK [Wait for instance(s) creation to complete] *******************************
failed: [localhost] (item=molecule-debian) => {"ansible_job_id": "j924757234159.28149", "ansible_loop_var": "item", "attempts": 2, "changed": true, "cmd": ["/usr/bin/podman", "run", "-d", "--name", "molecule-debian", "--privileged=True", "--volume", "/sys/fs/cgroup:/sys/fs/cgroup:ro", "--tmpfs=/run", "--tmpfs=/tmp", "--hostname=molecule-debian", "--systemd=true", "molecule_local/debian:12", "/lib/systemd/systemd"], "delta": "0:00:00.834539", "end": "2023-10-30 12:24:40.182667", "finished": 1, "item": {"ansible_job_id": "j924757234159.28149", "ansible_loop_var": "item", "changed": true, "failed": 0, "finished": 0, "item": {"command": "/lib/systemd/systemd", "dockerfile": "Containerfile.j2", "image": "debian:12", "name": "molecule-debian", "pre_build_image": false, "privileged": true, "systemd": true, "tmpfs": ["/run", "/tmp"], "volumes": ["/sys/fs/cgroup:/sys/fs/cgroup:ro"]}, "results_file": "/home/sbf/.ansible_async/j924757234159.28149", "started": 1}, "msg": "non-zero return code", "rc": 126, "results_file": "/home/sbf/.ansible_async/j924757234159.28149", "start": "2023-10-30 12:24:39.348128", "started": 1, "stderr": "Error: OCI runtime error: crun: chmod `run/shm`: Operation not supported", "stderr_lines": ["Error: OCI runtime error: crun: chmod `run/shm`: Operation not supported"], "stdout": "", "stdout_lines": []}

but even once you get past this, I think there will be a new error when installing python packages