Hello,
I am testing out using ansible navigator with my own EE. I just used Rocky Linux 10 UBI for my base image and used ansible builder to get the EE.
I am having trouble finding documentation that specifies how I can pass the --user option to ansible navigator but for the container engine—which in my case is podman—and also specify the connecting user via command line all in one shot.
So far, I’ve been trying out using --container-options as an option for ansible navigator and then giving it the --user=ansible option that I want it to add to the podman execution.
I am getting an error about missing argument:
ansible-navigator run: error: argument --co/–container-options: expected at least one argument
screenshot with error and podman/ansible-navigator version
The interesting part for me is that when I browse the navigator log, I see that it is adding the option as I expect it to and so I’m not sure if this is a bug or I am just not allowed to do this or supposed to do this.
screenshot of ansible-navigator.log
I should mention that in my screenshot, my first attempt was using argument user=ansible to --co which I did so that the log would record what I’m trying to show and I on purpose didn’t include the double hyphens.
In my last attempt, you will see that I did include them and I got the error I’m running into. Not sure how else I’m supposed to pass it via command line. I tried with the config file for ansible navigator but it didn’t work either.
When I don’t try to use --co to try and override the container user, ansible navigator keeps trying to run container command (i.e. ansible) as root and this is not what I want.
Try replacing just --co '--user=ansible' with --container-options=--user=ansible, leaving the rest of your command unchanged. The navigator project’s Podman example uses that --container-options=... form to pass a value beginning with --. I haven’t tested your EE, so could you check whether this gets past the argument error before tackling the container user behaviour?
Assisted-by: AI.
For the second part of your question, the container user and the connecting user are two different settings, so they are set in two different places. The container user is the user the EE runs as under Podman, which is what --container-options=–user=ansible is for. As Rei_Kurosawa suggested, the = form is the key part, since a value starting with – gets swallowed as a new option otherwise. The connecting user is the user Ansible logs in as on your managed hosts. That one is not a navigator option at all: set ansible_user for the host or group in your inventory, for example ansible_user=ansible, or set remote_user = ansible in ansible.cfg. Navigator just runs ansible-playbook inside the EE, so it picks that up the same way. Did the = form get you past the argument error? If it did, the next thing to check is whether the ansible user exists inside the EE image, since Podman will fail if that user does not exist in the container.
Thanks guys. I will post back once I get to test this. 
Thanks @Rei_Kurosawa and @thequranclass that did the trick!
I’m running into a different issue now and I think it has to do with permission on the default working dir which seems to be /runner but I think I can figure it out. Will keep working at it. Thanks!