Commit 715d668d authored by Markus Frosch's avatar Markus Frosch
Browse files

Add autorole to classify hosts

parent 6309e6d9
class icinga2_testing::roles::autorole
{
if ! $::icingatest_instance {
fail('Fact or parameter "icingatest_instance" is not present, hostname may not be conform!')
}
if $::icingatest_instance and $::icingatest_role and $::icingatest_hostno {
notice("Running autorole in instance=${::icingatest_instance} - role=${::icingatest_role} - hostno=${::icingatest_hostno}")
# check config that has to be present in hiera
$zones_config = hiera('icinga2::object::zone')
$repo_version = hiera('icinga2_testing::profiles::repository::version')
if $::icingatest_role == 'master' {
include ::icinga2_testing::roles::master
if $::icingatest_hostno == 1 {
include ::icinga2_testing::roles::master_config
}
}
elsif $::icingatest_role == 'satellite' {
include ::icinga2_testing::roles::satellite
}
else {
fail("Unsupported role '${::icingatest_role}'!")
}
}
else {
fail("Could not identify host '${::fqdn}' by facts or parameters!")
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment