Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type mismatch for 'login.LdapConfig.servers': when using heira #124

Open
tylerfrench opened this issue Jul 28, 2017 · 0 comments
Open

Type mismatch for 'login.LdapConfig.servers': when using heira #124

tylerfrench opened this issue Jul 28, 2017 · 0 comments

Comments

@tylerfrench
Copy link

I have setup roles and profiles in my puppet environment and am using hiera to setup my grafana node. Everything is working as it should however when adding the config part for ldap i am getting the following error:
Type mismatch for 'login.LdapConfig.servers': Expected slice but found 'map[string]interface {}'

I have figured out that the issue is when using hiera the config file needs to be laid out like so:

---
grafana::install_method: 'package'
grafana::cfg:
        app_mode: 'production'
        server:
                http_port: '8080'
        database:
                type: 'mysql'
                host: '172.0.0.1:3306'
                name: 'grafana'
                user: 'root'
                password: 'secretpassword'
        users:
                allow_sign_up: false
        auth.ldap:
                enabled: true
                config_file: '/etc/grafana/ldap.toml'
grafana::ldap_cfg:
        servers:
                host: "dc01.tom.future.lab"
                port: 389
                use_ssl: false
                search_filter: '(sAMAccountName=%s)'
                search_base_dns:
                        - 'dc=tom,dc=future,dc=lab'
                bind_dn: 'user@tom.future.lab'
                bind_password: 'secretpassword'
        servers.attributes:
                name: 'givenName'
                surname: 'sn'
                username: 'cn'
                member_of: 'memberOf'
                email: 'email'

When the ldap.toml file is then generated you get the following:

[servers]
bind_dn = "user@tom.future.lab"
bind_password = "secretpassword"
host = "dc01.tom.future.lab"
port = 389
search_base_dns = ["dc=tom,dc=future,dc=lab"]
search_filter = "(sAMAccountName=%s)"
use_ssl = false

[servers.attributes]
email = "email"
member_of = "memberOf"
name = "givenName"
surname = "sn"
username = "cn"

The config file that is generate has [servers] instead of [[servers]], i was able to get this working by changing the hiera file as follows:

grafana::ldap_cfg:
        '[servers]':

So not sure if this is a module, toml issue, or just something weird...

lukebigum pushed a commit to lukebigum/puppet-grafana that referenced this issue Oct 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant