Last active
October 26, 2016 15:41
-
-
Save droopy4096/7ca7be73d0f94e8b96b8e03856e785f6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node x.some.com { | |
users::collect_present_users(['tag1','cluster1']) | |
users::collect_absent_users(['tag1','cluster1']) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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