Skip to content

Commit

Permalink
Set user to root when podman (#1539)
Browse files Browse the repository at this point in the history
  • Loading branch information
cidrblock authored May 20, 2023
1 parent 8e43d29 commit 65f2286
Showing 1 changed file with 13 additions and 1 deletion.
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

0 comments on commit 65f2286

Please sign in to comment.