southalc / podman

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

podman::rootles fails with "Could not find resource " #58

Open tuxmaster5000 opened 1 year ago

tuxmaster5000 commented 1 year ago

Sample code:

$user = 'foo'
$user_home = "/var/lib/${user}"
group { $user: system => true }
user { $user:
    home       => $user_home,
    shell      => '/sbin/nologin',
    system     => true,
    managehome => true,    
    require    => Group[$user]
  }
class { 'podman':
    nodocker                 => absent,
    podman_docker_pkg_ensure => absent,
    manage_subuid            => true,
  }
  podman::rootless { $user: }

It will fails with: Error 500 on SERVER: Server Error: Could not find resource 'File[/var/lib/foo]' in parameter 'require' I think the problem is line 22 and 24 of manifests/rootless.pp because puppet don't know the values on all times.

southalc commented 1 year ago

Interesting. The user attributes define "managehome => true", but that apparently does not add the directory as a file resource. To work around this, you should be able to declare $user_home as a separate file resource. I'm working on a rewrite of the module where I hope to address the current issues by using custom providers, but until it's finished this behavior won't change.