Skip to content
This repository was archived by the owner on Aug 22, 2023. It is now read-only.

LINUX / Podman Webserver: Does not output message in survey; stops but is not deleted #36

@benblasco

Description

@benblasco

This playbook outputs info that does not include the string put into the survey:

Identity added: /runner/artifacts/25/ssh_key_data (/runner/artifacts/25/ssh_key_data)
PLAY [Podman] ******************************************************************
TASK [Gathering Facts] *********************************************************
ok: [node3]
TASK [Install Podman] **********************************************************
changed: [node3]
TASK [Create volume dir] *******************************************************
changed: [node3]
TASK [Create index.html] *******************************************************
changed: [node3]
TASK [Run httpd container] *****************************************************
changed: [node3]
TASK [Check Web Page] **********************************************************
ok: [node3]
TASK [podman ps] ***************************************************************
ok: [node3]
TASK [Output] ******************************************************************
ok: [node3] => {
    "msg": [
        [
            "CONTAINER ID  IMAGE                           COMMAND           CREATED        STATUS            PORTS                 NAMES",
            "a0c89a3a3021  docker.io/library/httpd:latest  httpd-foreground  2 seconds ago  Up 2 seconds ago  0.0.0.0:8080->80/tcp  apache"
        ],
        "<html><body><h1>It works!</h1></body></html>\n"
    ]
}
PLAY RECAP *********************************************************************node3                      : ok=8    changed=4    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

The container then stops on the localhost but is never cleaned up:

[ec2-user@node3 ~]$ podman ps -a 
CONTAINER ID  IMAGE                           COMMAND           CREATED        STATUS                    PORTS                 NAMES
a0c89a3a3021  docker.io/library/httpd:latest  httpd-foreground  3 minutes ago  Exited (0) 3 minutes ago  0.0.0.0:8080->80/tcp  apache
[ec2-user@node3 ~]$ 

So the questions I have are:

  1. Where should i be able to see the string input into the survey? Via the playbook output or via curl localhost? I can't see it in either:
[ec2-user@node3 ~]$ podman start apache
apache
[ec2-user@node3 ~]$ curl localhost:8080
<html><body><h1>It works!</h1></body></html>
[ec2-user@node3 ~]$ 
  1. Should the container be deleted upon completion, or remain running?
  2. If you run this a second time, what's the expected behaviour? My observation is that it's idempotent so the container is left untouched, which is probably the desired outcome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions