Skip to content
This repository has been 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

Open
benblasco opened this issue Oct 25, 2022 · 4 comments

Comments

@benblasco
Copy link
Collaborator

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.
@willtome
Copy link
Collaborator

I think this demo needs to be revisited as a whole. All valid questions but not much work has gone into what the intention of this is. Open to suggestions.

@benblasco
Copy link
Collaborator Author

I have found the issue with the string put into the survey not showing. It's this block of code in podman.yml

  - name: Run httpd container
    containers.podman.podman_container:
      name: apache
      image: docker.io/httpd
      state: started
      volume:
        - "{{ volume_path }}:/usr/local/apache2/htdocs"

The volume_path variable is being interpreted as a volume name, rather than a filesystem path. See troubleshooting below:

Firstly, the file containing the message from the survey is put here:

[ec2-user@node1 ~]$ cat podman/index.html 
BBLASCO This is a web page I want to look at! 

However podman creates a volume called podman, and this is the path mounted into the container:

[ec2-user@node1 ~]$ podman volume ls
DRIVER      VOLUME NAME
local       podman

[ec2-user@node1 ~]$ podman volume inspect podman
[
     {
          "Name": "podman",
          "Driver": "local",
          "Mountpoint": "/home/ec2-user/.local/share/containers/storage/volumes/podman/_data",
          "CreatedAt": "2022-11-21T01:32:52.823839021Z",
          "Labels": {},
          "Scope": "local",
          "Options": {},
          "MountCount": 0
     }
]
[ec2-user@node1 ~]$ cat /home/ec2-user/.local/share/containers/storage/volumes/podman/_data/index.html 
<html><body><h1>It works!</h1></body></html>
[ec2-user@node1 ~]$ 

So we have two options for fixing this:
a) copy the correct message from the survey into the index.html in the podman volume named podman, OR
b) Ensure that the volume_path directory is interpreted as a path, rather than a podman volume name

I am inclined to go with whatever is simpler and will lodge a PR to fix this.

@benblasco
Copy link
Collaborator Author

Took the path of least resistance here and chose option B, ensuring volume_path is interpreted as a path instead of a podman volume name. This demo could potentially do with more work, but at least it has some sensible output now.

MKletz pushed a commit that referenced this issue Jan 5, 2023
* Switched from using podman volumes to file path (issue #36)

* Improved readability of output

* Added a sensible default message for web server (Issue #36)

Co-authored-by: Benjamin Blasco <[email protected]>
@benblasco
Copy link
Collaborator Author

@MKletz @willtome Can we close this issue?

willtome added a commit that referenced this issue Mar 6, 2023
add job template

fix I

add extra vars

add documentation

Added contributing doc (#2)

add contributing doc

cleaning up docs

add suggested usage

log demo

DERP

network demos

change role name

source update

add hub creds

add readme

add main readme

typo, no biggie (#23)

https://knowyourmeme.com/memes/but-its-honest-work

add notification

fix var

fix var

fix var

fix vars

fix vars

fix vars

fix vars

fix vars

add telemetry

update telemetry

add feedback

add feedback

add feedback

update windows stuff

bugs

bugs

bugs

bugs

add assert

add groups

update AD jobs

random pass

pin version for comm.gen

Add landing page (#25)

* work on landing page

* work on landing page

* work on landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* add files

* derp

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add ee

* add ee

* add ee

* fix landing page

* fix landing page

* fix landing page

* fix landing page

* fix landing page

* remove commented out sections

Increased the Idle Time Force Log Out (#28)

* increased timeout

* sdf

* asdf

* corrected key

Instruqt Refactor (#40)

* work on landing page

* work on landing page

* work on landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* add files

* derp

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add ee

* add ee

* add ee

* fix landing page

* fix landing page

* fix landing page

* fix landing page

* fix landing page

* remove commented out sections

* remove default ee

* set local admin password

* set ee for fact scan

* fall back to default ee for patching

* check for valid org_id

* check for valid org_id

* check admin username

* add remote_user

* credssp

* ntlm

Add network report job template (#44)

* Network report

Linux demo updates bblasco pt1 (#45)

* Improved description of Ansible group to address issue #29

* Ensured "at" package is present rather than latest for Issue #31

* Added timesync as a second example role to run (Issue #37)

Co-authored-by: Benjamin Blasco <[email protected]>

Added task to print STDOUT lines from script (Issue #33) (#46)

Co-authored-by: Benjamin Blasco <[email protected]>

Added Insights Compliance Scan (Issue #49) (#51)

Co-authored-by: Benjamin Blasco <[email protected]>

Linux demo updates bblasco podman (#47)

* Switched from using podman volumes to file path (issue #36)

* Improved readability of output

* Added a sensible default message for web server (Issue #36)

Co-authored-by: Benjamin Blasco <[email protected]>

Run insights scan (skip errors if not configured) (Issue #32) (#48)

* Run insights scan (skip errors if not configured) (Issue #32)

* Improved Insights client checks to use facts
defined by redhatinsights.insights.insights_client role

* Fixed missed call to debug module

* Updated message for clarity

Co-authored-by: Benjamin Blasco <[email protected]>

Issue 52 (#53)

* add fact scan

* add fact scan

* update patching role

* dont ask limit

* add become

Add Satellite Demos (#41)

* add satellite demos

* move satellite vars to setup.yml

* fix var

* fix playbook path

* remove async

* fix =

* fix condition

* fix lookup

* add credential

* update tools version

* fix scap role

* add satellite setup

* add satellite stuff

* remove local

* stupid

* stupid

* params

* these vars arent right

* these vars arent right

* add compliance workflow

* work on landing page

* work on landing page

* work on landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* add files

* derp

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add ee

* add ee

* add ee

* fix landing page

* fix landing page

* fix landing page

* fix landing page

* fix landing page

* remove commented out sections

* remove default ee

* set local admin password

* set ee for fact scan

* fall back to default ee for patching

* check for valid org_id

* check for valid org_id

* no gpg

* no gpg

* add satllite stuff

* update cred type

* update cred type

* raw

* raw

* work on landing page

* work on landing page

* work on landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* add files

* derp

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add ee

* add ee

* add ee

* fix landing page

* fix landing page

* fix landing page

* fix landing page

* fix landing page

* remove commented out sections

* remove default ee

* set local admin password

* set ee for fact scan

* fall back to default ee for patching

* check for valid org_id

* check for valid org_id

* no gpg

* no gpg

* add satllite stuff

* update cred type

* update cred type

* raw

* raw

* raw

* merge satellite

* fix vars

* fix vars

* fix vars

* fix vars

* add publish

* add lifecycle and actviation keys

* workaround for publish issue

* use module to publish

* use module to publish

* use module to publish

* use module to publish

* change sat version

* change sat version

* change sat version

* remove maint repos

* launch sat setup

* reorder

* reorder

* moar inventory

* add manifest refresh

* add telemetry

* run linux setup

* parent efcf729
author willtome <[email protected]> 1663173584 -0400
committer willtome <[email protected]> 1668183942 -0500

parent efcf729
author willtome <[email protected]> 1663173584 -0400
committer willtome <[email protected]> 1668183785 -0500

parent efcf729
author willtome <[email protected]> 1663173584 -0400
committer willtome <[email protected]> 1668183318 -0500

parent efcf729
author willtome <[email protected]> 1663173584 -0400
committer willtome <[email protected]> 1668182787 -0500

parent efcf729
author willtome <[email protected]> 1663173584 -0400
committer willtome <[email protected]> 1668182651 -0500

add satellite demos

work on landing page

landing page

landing page

landing page

landing page

landing page

landing page

landing page

landing page

landing page

landing page

landing page

add files

derp

add link

add link

add link

add link

add link

add link

add link

add link

add link

add link

add link

add link

add ee

add ee

add ee

fix landing page

fix landing page

fix landing page

fix landing page

fix landing page

remove commented out sections

remove default ee

set local admin password

set ee for fact scan

fall back to default ee for patching

check for valid org_id

check for valid org_id

no gpg

no gpg

add satllite stuff

update cred type

update cred type

raw

raw

raw

add satellite demos

move satellite vars to setup.yml

fix var

fix playbook path

remove async

fix =

fix condition

fix lookup

add credential

update tools version

fix scap role

add satellite setup

add satellite stuff

remove local

stupid

stupid

params

these vars arent right

these vars arent right

add compliance workflow

work on landing page

work on landing page

work on landing page

landing page

landing page

landing page

landing page

landing page

landing page

landing page

landing page

landing page

landing page

landing page

add files

derp

add link

add link

add link

add link

add link

add link

add link

add link

add link

add link

add link

add link

add ee

add ee

add ee

fix landing page

fix landing page

fix landing page

fix landing page

fix landing page

remove commented out sections

remove default ee

set local admin password

set ee for fact scan

fall back to default ee for patching

check for valid org_id

check for valid org_id

no gpg

no gpg

update cred type

update cred type

raw

merge satellite

 fix vars

 fix vars

 fix vars

 fix vars

add publish

add lifecycle and actviation keys

workaround for publish issue

use module to publish

use module to publish

use module to publish

use module to publish

change sat version

change sat version

change sat version

remove maint repos

launch sat setup

reorder

reorder

moar inventory

add manifest refresh

add telemetry

run linux setup

* Updates to node1 (#42)

clean up satellite config
clean up server registration
add web console job

Co-authored-by: Calvin Smith <[email protected]>

* add rhel 8 tailoring

* add ee

* dont verify certs

* Update setup.yml

* Update setup.yml

* what the heck

Co-authored-by: calvingsmith <[email protected]>
Co-authored-by: Calvin Smith <[email protected]>

Fixes for Issues 54 and 55 (#56)

* add fixes

* add survey for org id

updated version (#58)

add rhel9 (#18)

check-install missing packages (#63)

* check-install missing packages
* updated subcription manager installation
* move subscription manager install up

Bump ansible.controller version (#60)

* bump

* bumperino

* corrected

* Update requirements.yml

* Update requirements.yml

* Update requirements.yml

---------

Co-authored-by: willtome <[email protected]>

fix selinux variables (#66)

Integration of Content Lab for AWS (#67)

* add jobs

* role name

* scm

* naming

* add new jobs

* update URL

* add playbook

* add keypair

* fix spaces

* update setup

* add rhel9

* change to main branch
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants