ansible-navigator icon indicating copy to clipboard operation
ansible-navigator copied to clipboard

Running ansible-navigator from a non-root account causes error

Open noelmiller opened this issue 1 year ago • 4 comments

ISSUE TYPE
  • Bug Report
SUMMARY

There is an issue with ansible-navigator or possibly podman when using the su or su - switching from the root user to an unprivileged user and attempting to run the ansible-navigator command.

ANSIBLE-NAVIGATOR VERSION
ansible-navigator 2.2.0
CONFIGURATION
ansible-navigator:
  execution-environment:
    image: ansible-automation-platform-22/ee-supported-rhel8:latest
    pull:
      policy: missing
  playbook-artifact:
    enable: false
LOG FILE

https://gist.github.com/noelmiller/410131a2ffc51e756bef00dcd8e9af0f

STEPS TO REPRODUCE
  1. Connect to ansible control node server using root account using ssh: ssh root@control-node
  2. Do one of the following to switch to the unprivileged user account:
    1. su user
    2. su - user
    3. su --login user
  3. Navigate to directory with relevant ansible-navigator.yml config
  4. Run ansible-navigator (or any subcommand)
  5. You will receive the error I listed above
EXPECTED RESULTS

Expect the interactive ansible-navigator tui to appear, but instead I get the error below.

ACTUAL RESULTS
-------------------------------------------------------------------------------------------
Execution environment image and pull policy overview
-------------------------------------------------------------------------------------------
Execution environment image name:     ansible-automation-platform-22/ee-supported-rhel8:latest
Execution environment image tag:      latest
Execution environment pull arguments: None
Execution environment pull policy:    missing
Execution environment pull needed:    True
-------------------------------------------------------------------------------------------
Updating the execution environment
-------------------------------------------------------------------------------------------
Running the command: podman pull ansible-automation-platform-22/ee-supported-rhel8:latest
WARN[0000] RunRoot is pointing to a path (/run/user/1000/containers) which is not writable. Most likely podman will fail.
Error: default OCI runtime "crun" not found: invalid argument
  Error: Execution environment pull failed
   Hint: Check the execution environment image name, connectivity to and
         permissions for the registry, and try again
ADDITIONAL INFORMATION

This could be an issue with podman itself, I did find another resolved github issue talking about switching user from root to unprivileged user here: https://github.com/containers/podman/issues/8052

noelmiller avatar May 17 '23 22:05 noelmiller