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

Apply all changes during single Puppet run #60

Closed
deric opened this issue Nov 18, 2016 · 1 comment
Closed

Apply all changes during single Puppet run #60

deric opened this issue Nov 18, 2016 · 1 comment
Milestone

Comments

@deric
Copy link
Owner

deric commented Nov 18, 2016

When creating a new group its members are not updated in /etc/group, the result looks like this

$ id deployer
uid=1010(deployer) gid=1002(deployer) groups=1002(deployer)
$ getent group deployer
deployer:x:1002:

although the second command should output deployer:x:1002:deployer. This change is made after second Puppet run.

Minimal code to reproduce the issue:

class {'::accounts':
  users => {
    'deployer' => {
      'uid' => '1010',
    }
  }
}
@deric
Copy link
Owner Author

deric commented Nov 18, 2016

It looks more like an Linux issue than Puppet problem. Executing following sequence

groupadd deployer
gpasswd -a deployer deployer

won't modify /etc/group file (in same shell session), unless the group is already defined. In order to bypass the problem I'm using a nasty sed expression to update /etc/group (which would have been done upon next puppet run)

sed -i.bak -e 's/^\\(deployer\\)\\(.*\\)/\\1\\2deployer/g' /etc/group

which ensures that following line exists:

deployer:x:1002:deployer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant