-
Notifications
You must be signed in to change notification settings - Fork 40
Enable LDAP authentication for Grafana #108
Conversation
Modified profile::master::install to install toml gem. Created ldap.toml.epp template for LDAP config.
puppet_metrics_dashboard::profile::ldap_auth is a classthat may have no external impact to Forge modules. puppet_metrics_dashboard::profile::master::install is a classthat may have no external impact to Forge modules. This module is declared in 0 of 575 indexed public
|
|
I have an LDAP server already set up. So I can create a new LDAP user for the reviewer, to make things a bit easier. |
|
I get a duplicate class declaration error when applying this. I have included the error and the contents of my site.pp for reference. Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Duplicate declaration: Class[Puppet_metrics_dashboard] is already declared at (file: /etc/puppetlabs/code/environments/production/manifests/site.pp, line: 64); cannot redeclare (file: /etc/puppetlabs/code/environments/production/modules/puppet_metrics_dashboard/manifests/profile/ldap_auth.pp, line: 85) (file: /etc/puppetlabs/code/environments/production/modules/puppet_metrics_dashboard/manifests/profile/ldap_auth.pp, line: 85, column: 3) on node dashboard.puppetdebug.vlan |
manifests/grafana.pp
Outdated
| @@ -21,6 +21,16 @@ | |||
| require => Package['grafana'], | |||
| before => Service['grafana-server'], | |||
| } | |||
| } | |||
|
|
|||
| if $puppet_metrics_dashboard::enable_ldap_auth { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't add an if here, because the else below it is already part of the first if statement above. I'd suggest approaching this by setting a new variable $ldap_config with the keys / values you need and then doing an additional merge below (see line 48) so that everything ends up in the $_grafana_cfg var.
You'll also need to update spec tests in spec/classes/grafana_spec.rb because we don't currently expect ldap config to be there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just pushed some updates to address this.
Created ldap_auth.pp to enable LDAP authentication to the dashboard.
Modified profile::master::install to install toml gem.
Created ldap.toml.epp template for LDAP config.