| Puppet Version: 5.4.0 Puppet Server Version: 5.2.0 OS Name/Version: RHEL 7 group { 'group1' : ensure => present, gid => '901', forcelocal => true, } group { 'group2' : ensure => present, gid => '902', forcelocal => true, } user { 'user1' : ensure => present, home => '/home/user1', uid => '900', gid => 'user1', comment => 'user1', shell => '/bin/bash', forcelocal => true, managehome => true, groups => ['group1', 'group2'], require => Group['group1', 'group2'], } So far I have found two issues. 1) lusermod does not support -G
- lusermod --help
Usage: lusermod [OPTION...] user -i, --interactive prompt for all information -c, --gecos=STRING GECOS information -d, --directory=STRING home directory -m, --movedirectory move home directory contents -s, --shell=STRING set shell for user -u, --uid=NUM set UID for user -g, --gid=NUM set primary GID for user -l, --login=STRING change login name for user -P, --plainpassword=STRING plaintext password for the user -p, --password=STRING pre-hashed password for the user -L, --lock lock account -U, --unlock unlock account --commonname=STRING set common name for user --givenname=STRING set given name for user --surname=STRING set surname for user --roomnumber=STRING set room number for user --telephonenumber=STRING set telephone number for user --homephone=STRING set home telephone number for user
Help options: -?, --help Show this help message --usage Display brief usage message 2) the new code will not "modify" the user's groups in /etc/group because the user already exists. Desired Behavior: user type allowed to modify local users groups Actual Behavior: Error: UID 900 already exists, use allowdupe to force user creation Error: /Stage[main]/Localusers::Identities/User[user1]/groups: change from to 'group1,group2' failed: UID 900 already exists, use allowdupe to force user creation |