Skip to content
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
13 changes: 13 additions & 0 deletions sos/report/plugins/aap_containerized.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,19 @@ def setup(self):
subdir="aap_containers_log"
)

if "automation-controller-task" in aap_containers:
container = "automation-controller-task"
podman_commands = [
(f"su - {username} -c 'podman exec -it {container} bash -c"
" \"awx-manage check_license --data\"'",
"awx-manage_check_license_--data"),
(f"su - {username} -c 'podman exec -it {container} bash -c"
" \"awx-manage list_instances\"'",
"awx-manage_list_instances"),
]
for command, filename in podman_commands:
self.add_cmd_output(command, suggest_filename=filename)
Comment on lines +112 to +121

@TurboTurtle TurboTurtle May 29, 2025

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this not work using the runas and container parameters for add_cmd_output()?

E.G.

podman_commands = [
    'awx-manage check-license --data'
    ...etc...
]
for command in podman_commands:
    self.add_cmd_output(command, suggest_filename=command, runas=username, container=container)

Or, now remembering we do have some limitations there, dropping the su bit and just using runas to execute the podman command directly?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my tests. With the runas and container, the sos report fails to find the container.

$ sos report -o aap_containerized -k aap_containerized.username=devops -vvv
...
[plugin:aap_containerized] Skipping command 'awx-manage check_license --data' as the requested container 'automation-controller-task' does not exist.
[plugin:aap_containerized] Skipping command 'awx-manage list_instances' as the requested container 'automation-controller-task' does not exist.

The same execution with the current commit collects the data correctly from the container.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TurboTurtle based on the output above, should I keep it with the su - commands?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, guess we should look into that. I have an idea as to why that's happening but it'd take a bit to address it and I don't want that to hold this up any further.

ack, with a note on me to look into the runas and container combination.


# Function to fetch podman container names
def _get_aap_container_names(self, username):
try:
Expand Down
Loading