Created
August 30, 2018 06:08
-
-
Save sshastri/a491bf322de753d36430594be226eb55 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
# - Warning if pp_role not defined | |
# - Check to see if the role exists | |
# - Fall back to using the base profile | |
node default { | |
# Save the role fact into a local variable | |
$role = $facts['role'] | |
case $role { | |
default: { | |
# Check if the role class has been defined. | |
# Include it if so. If not, include the base profile and a warning. | |
if defined($role) { | |
include $role | |
} else { | |
notify { "No matching role for ${role} found": | |
loglevel => 'warning', | |
} | |
include profile::base | |
} | |
} | |
undef, '': { | |
notify { "${trusted['certname']} does not have a role fact!": | |
loglevel => 'warning', | |
} | |
include profile::base | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment