Managing a user password for linux in puppet

后端 未结 8 968
心在旅途
心在旅途 2020-12-07 16:00

I need to create a test user with a password using puppet.

I\'ve read that puppet cannot manage user passwords in a generic cross-platform way, which is a pity. I am

8条回答
  •  盖世英雄少女心
    2020-12-07 16:12

    The stdlib package of puppetlabs implements a similar pw_hash function of the accepted answer.

    Be sure to add the library to your configuration. If you use librarian, just add in your Puppetfile

    mod 'puppetlabs-stdlib'
    

    Then to create an user, simply :

    user { 'user':
      ensure => present,
      password => pw_hash('password', 'SHA-512', 'mysalt'),
    }
    

提交回复
热议问题