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

Invalid port variable for LDAP configuration #29

Closed
soerenbe opened this issue Mar 1, 2017 · 6 comments
Closed

Invalid port variable for LDAP configuration #29

soerenbe opened this issue Mar 1, 2017 · 6 comments
Labels
bug Something isn't working skip-changelog

Comments

@soerenbe
Copy link

soerenbe commented Mar 1, 2017

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: Agent 3.7.2, Server 3.4.3
  • Ruby: Agent: 2.1.5p273 (system package) Server: 1.9.3p484 (system package)
  • Distribution: Agent: Jessie, Server: Trusty
  • Module version: 2.6.3
  • toml version: toml-0.1.2

How to reproduce (e.g Puppet code you use)

  class { 'grafana':
    manage_package_repo => false,
    install_method      => 'repo',
    version             => '4.1.2-1487860575',
    cfg                 => {
      security  => {
        admin_user     => 'admin',
        admin_password => 'xxx',
        secret_key     => 'xxx',
      },
      snapshots  => {
        external_enabled => false,
      },
      users      => {
        allow_sign_up    => false,
        allow_org_create => false,
      },
      analytics   => {
        reporting_enabled => false,
      },
      smtp        => {
        enabled      => true,
        host         => 'localhost:25',
        from_address => "admin@${::fqdn}",
        from_name    => 'Dashboard Admin'
      },
      'auth.ldap' => {
        enabled     => true,
        config_file => '/etc/grafana/ldap.toml',
      },
    },
    ldap_cfg => {
      servers => [
        { host            => 'xxx',
          use_ssl         => true,
          search_filter   => '(sAMAccountName=%s)',
          search_base_dns => [ 'xxx' ],
          bind_dn         => 'xxx',
          bind_password   => 'xxx',
          port            => 3269,
        },
      ],
      'servers.attributes' => {
        name      => 'givenName',
        surname   => 'sn',
        username  => 'sAMAccountName',
        member_of => 'memberOf',
        email     => 'mail',
      },
      'servers.group_mappings' => [
        { group_dn => 'xxx',
          org_role => 'Viewers',
        },
        ]
    },
  }

What are you seeing

When depolying this configuration the module produce a invalid port entry in /etc/grafana/ldap.toml.

# cat /etc/grafana/ldap.toml | grep port
port = "3269"

With this configuration grafana-server refuses to start.

Mär 01 17:40:59 dashboard grafana-server[62396]: t=2017-03-01T17:40:59+0100 lvl=crit msg="Failed to load ldap config file" logger=ldap error="Type mismatch for 'login.LdapConfig.servers': Type mismatch for 'login.LdapServerConf.port': Expected integer but found 'string'."

What behaviour did you expect instead

Following configuration would work:

# cat /etc/grafana/ldap.toml | grep port
port = 3269

Any additional information you'd like to impart

Since I am not very good at ruby and this TOML is magic for me I can not post a pull request. This also could be a TOML problem and not related to this module.

Best Regards,
Sören

@ffrank
Copy link

ffrank commented Mar 10, 2017

Thanks for this report!

@furhouse
Copy link

furhouse commented Apr 5, 2017

@soerenbe I just used your config as example, and if you would append +0 to 3269 (so port => 3269+0, as mentioned in the README (Integer note), it produces the expected result, and grafana-server will should start just fine.

@soerenbe
Copy link
Author

soerenbe commented Apr 5, 2017

Thanks for this hint!
I wil try this. At least I can use the configuration and dont have to manage the configuration file by hand.

But it is still a bug. :)

@ffrank
Copy link

ffrank commented Apr 6, 2017

Aye. Will tackle this once I've got some time on my hands.

@wyardley wyardley added the bug Something isn't working label Sep 20, 2017
@dhoppe
Copy link
Member

dhoppe commented Mar 26, 2019

I think we should get rid of tool, because the project has not seen any commit for more than one year.

@alexjfisher
Copy link
Member

The workaround in the README, did work, but was only required up until Puppet 4. Since we dropped support for Puppet 3 a long time ago, the workaround in the README was removed in #281

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working skip-changelog
Projects
None yet
Development

No branches or pull requests

6 participants