Skip to content

Commit

Permalink
Merge pull request #255 from ripienaar/254
Browse files Browse the repository at this point in the history
(#254) add scout agent policies
  • Loading branch information
ripienaar authored Jul 17, 2020
2 parents 9b49619 + 3a75aa9 commit 6478c4d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
7 changes: 7 additions & 0 deletions data/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ mcollective::rpcutil_policies:
facts: "*"
classes: "*"

mcollective::scout_policies:
- action: "allow"
actions: "checks"
callers: "*"
facts: "*"
classes: "*"

mcollective::plugin_classes:
- "mcollective_choria"
- "mcollective_agent_puppet"
Expand Down
15 changes: 15 additions & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,21 @@
notify => Class["mcollective::service"]
}

$scout_policy_content = epp("mcollective/policy_file.epp", {
"module" => "scout",
"policy_default" => $mcollective::policy_default,
"policies" => $mcollective::scout_policies,
"site_policies" => $mcollective::site_policies
})

file{"${mcollective::configdir}/policies/scout.policy":
owner => $mcollective::plugin_owner,
group => $mcollective::plugin_group,
mode => $mcollective::plugin_mode,
content => $scout_policy_content,
notify => Class["mcollective::service"]
}

if $mcollective::default_rego_policy_source != "" {
file{"${mcollective::configdir}/policies/rego/default.rego":
owner => $mcollective::plugin_owner,
Expand Down
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
# @param site_policies Policies to apply to all agents after any module specific policies
# @param rpcutil_policies Policies to apply to the special rpcutil agent
# @param choria_util_policies Policies to apply to the special choria_util agent
# @param scout_policies Policies to apply to the special scout agent
# @param manage_package Install mcollective package on this node
# @param package_name The name of the package to install if manage_package is enabled
# @param package_ensure Ensure value for the package
Expand Down Expand Up @@ -63,6 +64,7 @@
Array[Mcollective::Policy] $site_policies = [],
Array[Mcollective::Policy] $rpcutil_policies = [],
Array[Mcollective::Policy] $choria_util_policies = [],
Array[Mcollective::Policy] $scout_policies = [],
String $default_rego_policy_source,
Boolean $manage_package,
Enum["present", "latest"] $package_ensure,
Expand Down

0 comments on commit 6478c4d

Please sign in to comment.