Resource User


title: “Resource User”
date: 2016-01-13T10:15:13
slug: resource-user


root@host1:/home/ubuntu# puppet resource user root
user { 'root':
 ensure => 'present',
 comment => 'root',
 gid => '0',
 home => '/root',
 password => '\*',
 password\_max\_age => '99999',
 password\_min\_age => '0',
 shell => '/bin/bash',
 uid => '0',
}

Modify Resource (/bin/bash to /bin/sh):

puppet resource user root > user.pp
vi user.pp

user { 'root':
 shell => '/bin/sh',
}
root@host1:/home/ubuntu# puppet apply user.pp
Notice: Compiled catalog for host1.nyc2.example.com in environment production in 0.05 seconds
Notice: /Stage[main]/Main/User[root]/shell: shell changed '/bin/bash' to '/bin/sh'
Notice: Finished catalog run in 0.13 seconds
Print Friendly, PDF & Email