Hello Everyone,
    So I'm trying to create templates for system users.  Here is my
systemusers class:
~~~
class base::systemusers (
  $username = $title,
  $home     = "/var/lib/$username",
) {
  $systemusers   = lookup({ name => 'base::systemusers' })
  user { $username:
    ensure     => present,
    system     => true,
    uid        => $systemusers[$username]['uid'],
    home       => $home,
    managehome => true,
    shell      => '/bin/bash',
  }

  file { "$home/.ssh":
    ensure  => directory,
    owner   => $username,
    group   => $username,
    mode    => '0700',
  }

  file { "/var/run/$username":
    ensure  => directory,
    owner   => $username,
    group   => $username,
    mode    => '0755',
  }

  file { "/var/log/$username":
    ensure  => directory,
    owner   => $username,
    group   => $username,
    mode    => '0755',
  }
~~~

This works great when I only have 1 system user but the minute I have more
than 1 I get a *Duplicate declaration: Class[Base::Systemusers] *error.
I've looked at the docs for virtual resources (tbh, it breaks my brain a
little) but all the examples seem to be for general resources and not
classes.  I've tried a bunch of different iterations to solve this and I
haven't gotten any of them to work.  If someone could point me in the right
direction, I'd appreciate it.

Thanks,
-Dan

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAMGSraH5Sn31xPt8Z4DN8Xj74g20TZZ4z%3DPgD5TwgP%3DtWRT%3DxQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to