Skip to content

Instantly share code, notes, and snippets.

@droopy4096
Last active October 26, 2016 15:41
Show Gist options
  • Save droopy4096/7ca7be73d0f94e8b96b8e03856e785f6 to your computer and use it in GitHub Desktop.
Save droopy4096/7ca7be73d0f94e8b96b8e03856e785f6 to your computer and use it in GitHub Desktop.
node x.some.com {
users::collect_present_users(['tag1','cluster1'])
users::collect_absent_users(['tag1','cluster1'])
}
class users::collect_users ( $collector_tags ) {
User <| tag in $collector_tags |>,
}
class users::collect_present_users inherit users::collect_users( $collector_tags ){
User <| tag in $collector_tags |> {
ensure => "present",
}
}
class users::collect_absent_users inherit users::collect_users( $collector_tags ){
User <| tag not in $collector_tags |> {
ensure => "absent",
}
}
class users::virt_users {
@user { "someuser":
ensure => "present",
uid => "10001",
gid => "100",
comment => "Some User",
managehome => "true",
home => "/home/someuser",
shell => "/sbin/nologin",
tag => ['cluster1','cluster2','tag1','tag2']
}
@user { "absentuser":
ensure => "present",
uid => "10002",
gid => "100",
comment => "Some Absent User",
managehome => "true",
home => "/home/someuser",
shell => "/sbin/nologin",
tag => ['cluster2','tag2']
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment