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

  • Stephen Wood at Jul 31, 2014 at 7:21 pm
    Anybody have any ideas why the test user is not being aded to the group? Or
    while group membership is not being enforced? I have a feeling it's a bug
    so I'm going to file a report. I was running this test in masterless.

    Here's the missing original data regarding my versions:

                Salt: 2014.1.0
              Python: 2.6.6 (r266:84292, Jan 22 2014, 09:42:36)
              Jinja2: 2.2.1
            M2Crypto: 0.20.2
      msgpack-python: 0.1.13
        msgpack-pure: Not Installed
            pycrypto: 2.0.1
              PyYAML: 3.10
               PyZMQ: 2.2.0.1
                 ZMQ: 3.2.4


    On Wed, Jul 30, 2014 at 5:35 PM, Stephen Wood wrote:

    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?


    --
    Stephen Wood
    www.heystephenwood.com

    --
    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.
  • Mike Shade at Jul 31, 2014 at 10:23 pm
    My first suggestion would be to try a more recent version -- 2014.1.7 was
    released recently, and salt moves pretty quickly. It may no longer be an
    issue.

    On Thu, Jul 31, 2014 at 3:20 PM, Stephen Wood wrote:

    Anybody have any ideas why the test user is not being aded to the group?
    Or while group membership is not being enforced? I have a feeling it's a
    bug so I'm going to file a report. I was running this test in masterless.

    Here's the missing original data regarding my versions:

    Salt: 2014.1.0
    Python: 2.6.6 (r266:84292, Jan 22 2014, 09:42:36)
    Jinja2: 2.2.1
    M2Crypto: 0.20.2
    msgpack-python: 0.1.13
    msgpack-pure: Not Installed
    pycrypto: 2.0.1
    PyYAML: 3.10
    PyZMQ: 2.2.0.1
    ZMQ: 3.2.4


    On Wed, Jul 30, 2014 at 5:35 PM, Stephen Wood wrote:

    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?


    --
    Stephen Wood
    www.heystephenwood.com

    --
    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.
    --
    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.
  • JC at Aug 2, 2014 at 7:17 pm
    I'm having exactly the same problem; also tried with addusers instead of
    members, no difference. This is on Ubuntu 14.04.1 64bit server, my versions:
                Salt: 2014.1.7
              Python: 2.7.6 (default, Mar 22 2014, 22:59:56)
              Jinja2: 2.7.2
            M2Crypto: 0.21.1
      msgpack-python: 0.3.0
        msgpack-pure: Not Installed
            pycrypto: 2.6.1
              PyYAML: 3.10
               PyZMQ: 14.0.1
                 ZMQ: 4.0.4

    So 2014.1.7 does not seem to fix this, at least for me. Anyone else?


    Am Donnerstag, 31. Juli 2014 02:36:20 UTC+2 schrieb Stephen Wood:
    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.
  • Don Harden at Sep 12, 2014 at 5:38 pm
    Also having this issue 2014.1.10 running on CentOS 6.5

    Thanks,
    Don




    On Wednesday, July 30, 2014 8:36:20 PM UTC-4, Stephen Wood wrote:

    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.

Related Discussions

Discussion Navigation
viewthread | post
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