Ask Your Question
0

Password change not working from puppet master to its agent

asked 2016-12-14 23:03:47 -0500

vidyasagar.reddy66@gmail.com gravatar image

updated 2016-12-14 23:04:55 -0500

I have written a site.pp to change a password from the puppet master. Below is the site.pp. It is changing the password on agent host idrac-h868gm1, but when I try to login with the changed password (In this case devuser888) it is not working.

I used single and double quotes but it still does not work. I manually changed the password to devuser888 and it is working.

 node default {
 class { 'ntp':
servers => ['ntp1','ntp2']
}
 include ntp
 }
  node /^(prod|dev)\d+$/ {
  include mounts
  include nis
  }
 node idrac-h868gm1 {
 user { 'dev':
 ensure   => present,
 password => "devuser888"
 }

}

Puppet server version: 2.7.1 (open source)
Puppet agent version: 4.8.0
Puppet agent OS: RHEL7.2

Below is the debug logs from puppet agent link

link text

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2016-12-15 18:34:19 -0500

updated 2016-12-15 18:59:44 -0500

As lupin already pointed out the password attribute wants an encrypted password.

Order your node defintions from 'exact match' to 'catch-all':

node 'idrac-h868gm1' {
  user { 'dev':
    ensure   => present,
    # evaluate this statement once, and it put in place
    password => generate('/usr/bin/mkpasswd -m sha-512 devuser888'),
  }
}

node /^(prod|dev)\d+$/ {
  include mounts
  include nis
}

node default {
  class { 'ntp':
    servers => ['ntp1', 'ntp2'],
  }
  #!include ntp # either `include` ntp class, XOR
  # include it via a resource like statement (like above)
}
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-12-14 23:03:47 -0500

Seen: 29 times

Last updated: Dec 15 '16