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

Notice on every run for password_hash #425

Closed
ghost opened this issue Nov 27, 2017 · 4 comments · Fixed by #455
Closed

Notice on every run for password_hash #425

ghost opened this issue Nov 27, 2017 · 4 comments · Fixed by #455
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Nov 27, 2017

Short problem description:
On each and every run I get 'notice' output for the defined password_hash.
Example:

Notice: /Stage[main]/Mongodb::Server/Mongodb::Db[admin]/Mongodb_user[User admin on db admin]/password_hash: defined 'password_hash' as 'ahash'
Notice: /Stage[main]/Profiles::Mongodb/Mongodb_user[devuser]/password_hash: defined 'password_hash' as 'anotherhash'

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 4.10.5
  • Ruby: 2.0.0p648
  • Distribution: RHEL 7
  • Module version: 1.1.0

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

 if $auth {
    # Set auth enabled server vars
    # Default auth vars
    $default_auth_vars = {
      auth           => true,
      create_admin   => true,
      store_creds    => true,
    }
    # Take hiera data information
    $hiera_auth_vars = lookup('mongoadmin', Hash, hash, {
      admin_roles    => 'root',
      admin_username => 'admin',
      admin_password => '',
    })
    # Build authvars var
    $authvars = deep_merge($default_auth_vars,$hiera_auth_vars)
    #defaults for user creation
    $user_defaults = {
      ensure  => present,
      tries   => 3,
      require => Class['mongodb::server'],
    }
    # Get users and database config directly from hiera
    create_resources('mongodb_user', lookup('mongousers', Hash), $user_defaults)
  }
  else {
    # If auth is failed
    # set auth disabled server vars (default behaviour for legacy)
    $authvars = {
      auth           => false,
      create_admin   => false,
    }
  }

What are you seeing

Notice: /Stage[main]/Mongodb::Server/Mongodb::Db[admin]/Mongodb_user[User admin on db admin]/password_hash: defined 'password_hash' as 'ahash'
Notice: /Stage[main]/Profiles::Mongodb/Mongodb_user[devuser]/password_hash: defined 'password_hash' as 'anotherhash'

What behaviour did you expect instead

no notice output

Output log

Notice: /Stage[main]/Mongodb::Server/Mongodb::Db[admin]/Mongodb_user[User admin on db admin]/password_hash: defined 'password_hash' as 'ahash'
Notice: /Stage[main]/Profiles::Mongodb/Mongodb_user[devuser]/password_hash: defined 'password_hash' as 'anotherhash'

Any additional information you'd like to impart

@juniorsysadmin juniorsysadmin added the bug Something isn't working label Nov 27, 2017
@ekohl
Copy link
Member

ekohl commented Nov 27, 2017

I edited your commit to properly format the code. Could you tell us which mongodb version you're using? The one from EPEL?

I wonder if this is #327.

@ghost
Copy link
Author

ghost commented Nov 28, 2017

Thanks for your response. We're using version 3.4.9.
We acquired the version from https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.4/x86_64/RPMS/ and supply it through a private repository. This should be (and is) transparent to the puppet module.

The password hashing works as expected (takes the plain text and takes the hex md5 digest of it). The problem is simply the notice of puppet executing the hashing on every run.

@hostingnuggets
Copy link

Any news regarding this bug? I am using Debian 9 with the official MongoDB 3.2.11 package from the Debian APT repository and have the same problem with a very simple implementation of this module as you can see below:

	class {'mongodb::server':
		admin_username		=> 'admin',
		admin_password		=> 'REMOVED'
		auth			=> true,
		create_admin		=> true,
		store_creds		=> true,
	}

Puppet version is 4.8.2 from the Debian 9 APT repo.

@diranged
Copy link

I've got the same issue - with Mongo 3.6.9 on Ubuntu 14.

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

Successfully merging a pull request may close this issue.

4 participants