Skip to content

Commit

Permalink
Merge pull request #230 from ripienaar/229
Browse files Browse the repository at this point in the history
(#229) specifically activate clients and agents
  • Loading branch information
ripienaar authored Aug 18, 2019
2 parents bee4135 + 0f1fc43 commit 05917e0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions manifests/module_plugin.pp
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,25 @@
Optional[String] $group = $mcollective::plugin_group,
Optional[String] $mode = $mcollective::plugin_mode,
Enum["present", "absent"] $ensure = "present"
Boolean $activate_agent = true
Boolean $activate_client = true
) {
if $client or $server {
if ($server and $client) {
$merged_conf = $config.deep_merge($client_config).deep_merge($server_config)
$activate_config = {"activate_agent" => $activate_agent, "activate_client" => $activate_client}
$merged_conf = $config.deep_merge($client_config).deep_merge($server_config) + $activate_config
$merged_files = $common_files + $server_files + $client_files
$merged_directories = $common_directories + $server_directories + $client_directories

} elsif ($server) {
$merged_conf = $config.deep_merge($server_config)
$activate_config = {"activate_agent" => $activate_agent, "activate_client" => false}
$merged_conf = $config.deep_merge($server_config) + $activate_config
$merged_files = $common_files + $server_files
$merged_directories = $common_directories + $server_directories

} elsif ($client) {
$merged_conf = $config.deep_merge($client_config)
$activate_config = {"activate_agent" => false, "activate_client" => $activate_client}
$merged_conf = $config.deep_merge($client_config) + $activate_config
$merged_files = $common_files + $client_files
$merged_directories = $common_directories + $client_directories
}
Expand Down

0 comments on commit 05917e0

Please sign in to comment.