From 0dc1e03e742e1d9ba58d261c086f7654918f215c Mon Sep 17 00:00:00 2001 From: Cameron Johnston Date: Fri, 26 Feb 2016 09:44:01 -0700 Subject: [PATCH] add support for configuring sensu-enterprise-dashboard audit logging --- .../sensu_enterprise_dashboard_config/json.rb | 14 ++++++++++++++ .../type/sensu_enterprise_dashboard_config.rb | 10 ++++++++++ manifests/enterprise/dashboard/config.pp | 1 + manifests/init.pp | 1 + 4 files changed, 26 insertions(+) diff --git a/lib/puppet/provider/sensu_enterprise_dashboard_config/json.rb b/lib/puppet/provider/sensu_enterprise_dashboard_config/json.rb index 815bccfa99..45bceecfb9 100644 --- a/lib/puppet/provider/sensu_enterprise_dashboard_config/json.rb +++ b/lib/puppet/provider/sensu_enterprise_dashboard_config/json.rb @@ -134,6 +134,20 @@ def ssl conf['dashboard']['ssl'] end + # Public: Set the audit config + # + # Returns nothing. + def audit=(value) + conf['dashboard']['audit'] = value + end + + # Public: Get the Dashboard audit config + # + # Returns the audit config + def audit + conf['dashboard']['audit'] + end + # Public: Retrieve the Github config # # Returns the Github auth config diff --git a/lib/puppet/type/sensu_enterprise_dashboard_config.rb b/lib/puppet/type/sensu_enterprise_dashboard_config.rb index 081c833f87..d7a568f41c 100644 --- a/lib/puppet/type/sensu_enterprise_dashboard_config.rb +++ b/lib/puppet/type/sensu_enterprise_dashboard_config.rb @@ -66,6 +66,16 @@ def initialize(*args) end end + newproperty(:audit) do + desc "A hash of audit attributes to enable audit logging" + + validate do |value| + unless value.respond_to?(:to_hash) + raise ArgumentError, "Sensu Enterprise Dashboard audit config must be a Hash" + end + end + end + newproperty(:github) do desc "A hash of GitHub authentication attributes to enable GitHub authentication via OAuth. Overrides simple authentication." diff --git a/manifests/enterprise/dashboard/config.pp b/manifests/enterprise/dashboard/config.pp index 7ee44ce91c..c9c3415e5f 100644 --- a/manifests/enterprise/dashboard/config.pp +++ b/manifests/enterprise/dashboard/config.pp @@ -40,6 +40,7 @@ user => $::sensu::enterprise_dashboard_user, pass => $::sensu::enterprise_dashboard_pass, ssl => $::sensu::enterprise_dashboard_ssl, + audit => $::sensu::enterprise_dashboard_audit, github => $::sensu::enterprise_dashboard_github, ldap => $::sensu::enterprise_dashboard_ldap, } diff --git a/manifests/init.pp b/manifests/init.pp index 464634209e..4dc69d0b80 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -381,6 +381,7 @@ $enterprise_dashboard_user = undef, $enterprise_dashboard_pass = undef, $enterprise_dashboard_ssl = undef, + $enterprise_dashboard_audit = undef, $enterprise_dashboard_github = undef, $enterprise_dashboard_ldap = undef, $path = undef,