diff --git a/manifests/runner.pp b/manifests/runner.pp index a63631f..378f724 100644 --- a/manifests/runner.pp +++ b/manifests/runner.pp @@ -109,12 +109,21 @@ class podmanrunner::runner ( unless => "test -f /var/lib/systemd/linger/${user}${userpostfix}", } + # If required build runner image by podman-compose + exec { "${user}${userpostfix}-build-runner-image": + command => "${sdrun} /bin/bash -c 'podman-compose build'", + path => '/usr/bin:/usr/sbin:/bin', + provider => shell, + logoutput => false, + unless => "${sdrun} /bin/bash -c 'podman image ls | grep '^localhost/podmanrunner\s\s*3\.[0-9]\.[0-9]''", + } + # If not already done, register runner with forgejo instance. if $userdata and $userdata["token"] and $userdata["url"] { exec { "${user}${userpostfix}-register-runner": command => "${sdrun} /bin/bash -c 'podman run -it --rm -u podman -v ./runnerdata:/data:Z localhost/podmanrunner:3.3.0 /bin/bash -c \ \"date >> /data/register.log && forgejo-runner --config /data/config.yml register --no-interactive \ - --token ${userdata[\"token\"]} --name runner1 --instance ${userdata[\"url\"]} 1>>/data/register.log 2>&1\"'", + --token ${userdata["token"]} --name runner1 --instance ${userdata["url"]} 1>>/data/register.log 2>&1\"'", path => '/usr/bin:/usr/sbin:/bin', provider => shell, logoutput => false,