Last active
December 13, 2016 05:22
-
-
Save dominics/3fbe8f2598116497242f36896b70e5a6 to your computer and use it in GitHub Desktop.
Wrapping a class in a resource so it can be made virtual (i.e. datadog_agent::integrations::jenkins only included if datadog_agent is)
This file contains hidden or 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 profile::datadog::agent( | |
$ensure = 'present', | |
) { | |
class { | |
'datadog_agent': | |
puppet_run_reports => true; | |
} | |
# Realize wrapped integration classes | |
Profile::Datadog::Integration<| |> | |
} |
This file contains hidden or 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
define profile::datadog::integration( | |
$params = {} | |
) { | |
class { | |
"datadog_agent::integrations::$name": | |
* => $params; | |
} | |
} |
This file contains hidden or 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 profile::jenkins() { | |
# [...] | |
@profile::datadog::integration { | |
'jenkins': | |
params => { | |
path => '/var/lib/jenkins' | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment