FAQ
I am running a very simple statefile that doesn't appear to be working.

The state creates a user, then a group, then adders (some) users to a
group.

Here is an example statefile:

test_user:
   user.present

test_user_group:
   group.present:
     - members:
       - test_user

The state runs successfully but the "members" field is empty:

local:
----------
           ID: test_user
     Function: user.present
       Result: True
      Comment: New user test_user created
      Changes:
               ----------
               fullname:

               gid:
                   501
               groups:
                   - test_user
               home:
                   /home/test_user
               homephone:

               name:
                   test_user
               passwd:
                   x
               roomnumber:

               shell:
                   /bin/bash
               uid:
                   501
               workphone:

----------
           ID: test_user_group
     Function: group.present
       Result: True
      Comment: Added group test_user_group
      Changes:
               ----------
               gid:
                   502
               members:
               name:
                   test_user_group
               passwd:
                   x

Summary
------------
Succeeded: 2
Failed: 0
------------
Total: 2

when I check membership, my test user is not added (or removed if I remove
it from the list under "members").

$ cat /etc/group | grep test
test_user:x:501:
test_user_group:x:502:

I can successfully add the user to the group if I specify it as a parameter
for user.present, but I'd rather not:

    - I want group membership to be done via the group.present function,
    since it's pulling from a pillar value
    - I want to avoid conflict where the user.present adds a user to a group
    but then group membership deletes it within the same state run.

Any ideas what I'm doing wrong here or how I can work around this?

--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 5 | next ›
Discussion Overview
groupsalt-users @
postedJul 31, '14 at 12:36a
activeSep 12, '14 at 5:38p
posts5
users4

People

Translate

site design / logo © 2022 Grokbase