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

Buggy user.optional_groups behavior #4069

Closed
ryba-xek opened this issue Mar 12, 2013 · 1 comment
Closed

Buggy user.optional_groups behavior #4069

ryba-xek opened this issue Mar 12, 2013 · 1 comment
Milestone

Comments

@ryba-xek
Copy link

Briefly, the bug is optional_groups for user are applied only on second state application.

I get a clean ubuntu server 12.04 machine. Then I install salt-minion with this cmd:

curl -L http://bootstrap.saltstack.org | sudo sh -s

Then I convert is into masterless mode:

ubuntu@ubuntu:~$ cat /etc/salt/minion | grep -Ev '^#|^$'
file_client: local
file_roots:
  base:
    - /home/ubuntu
pillar_roots:
  base:
    - /home/ubuntu/pillar

Then I create these simple states:

cat ~ubuntu/top.sls

base:
  '*':
    - user

cat ~ubuntu/user.sls 

xek:
  user.present:
    - fullname: Xek
    - shell: /bin/zsh
    - home: /home/xek
    - groups:
      - sudo
      - www-data
    - optional_groups:
      - adm
      - cdrom
      - dip
      - plugdev
      - lpadmin
      - sambashare
      - wheel

Then I run salt the first time:

sudo salt-call state.highstate -l debug

and I get log #1
log 1

User gets no optional groups at all:

groups xek
xek : xek sudo www-data

but they all exist except 'wheel':

id
uid=1000(ubuntu) gid=1000(ubuntu) groups=1000(ubuntu),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),111(lpadmin),112(sambashare)

on the second run I get everything the way it's expected:
log 2

Python version: 2.7.3
Ubuntu version: 12.04
salt-minion version: 0.13.1

Clean ubuntu image was downloaded from: http://sourceforge.net/projects/virtualboximage/files/UbuntuServer/12.04/ubuntu-12.04-server-i386.7z

login: ubuntu,
pass: reverse

@UtahDave
Copy link
Contributor

Thanks!

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

2 participants