Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set user to root with podman #1539

Merged
merged 1 commit into from
May 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/ansible_navigator/runner/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ def __init__(
self.finished: bool = False
self.status: str | None = None
self._runner_args: dict = {}

# when the ce is podman, set the container user to root
if self._ce == "podman":
if container_options:
container_options.append("--user=root")
else:
container_options = ["--user=root"]

if self._ee:
self._runner_args.update(
{
Expand Down Expand Up @@ -119,7 +127,11 @@ def __init__(

if self._navigator_mode == "stdout":
self._runner_args.update(
{"input_fd": sys.stdin, "output_fd": sys.stdout, "error_fd": sys.stderr},
{
"input_fd": sys.stdin,
"output_fd": sys.stdout,
"error_fd": sys.stderr,
},
)

def __del__(self):
Expand Down