southalc / podman

Puppet module for podman
Apache License 2.0
13 stars 30 forks source link

Creating Pods is Failing #50

Closed abotelho-cbn closed 2 years ago

abotelho-cbn commented 2 years ago

The error I'm getting:

Notice: /Stage[main]/MyModule::Openxpki/Podman::Pod[openxpki_pod]/Exec[create_pod_openxpki_pod]/returns: time="2022-08-26T14:30:03-04:00" level=error msg="XDG_RUNTIME_DIR directory \"/run/user/\" is not owned by the current user"
Error: 'podman pod create  --name 'openxpki_pod'  --publish '8443:443'' returned 1 instead of one of [0]
Error: /Stage[main]/MyModule::Openxpki/Podman::Pod[openxpki_pod]/Exec[create_pod_openxpki_pod]/returns: change from 'notrun' to ['0'] failed: 'podman pod create  --name 'openxpki_pod'  --publish '8443:443'' returned 1 instead of one of [0] (corrective)

This is what I am doing in code:

podman::pod { 'openxpki_pod':
    user    => openxpki,
    flags   => {
        publish  =>  [
            #'8080:80',
            '8443:443',
        ],
    },
}

Running the command as the user I want the pod to launch with: podman pod create --name 'openxpki_pod' --publish '8443:443' Is valid, and a pod is created.

edit 1: Originally mistook the issue, but pod creation fails regardless. edit 2: i've actually noticed I missed an important part of the error!

abotelho-cbn commented 2 years ago

So as it turns out, I had to explicitly set the UID and GID of the user/group that I was using for this pods/containers.