saltstack-formulas / users-formula

Configure users via pillar
http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
99 stars 360 forks source link

'gid_from_name' is an invalid keyword argument for 'user.present' (=> `usergroup`) #198

Closed garethhowell closed 5 years ago

garethhowell commented 5 years ago

I've been using this formula for a while. I recently pulled the latest version to overcome an issue where gitconfig failed, and I'm now getting an error.

Passed invalid arguments: 'gid_from_name' is an invalid keyword argument for 'user.present'.

The state simply calls users The relevant pillar data is

users:
  aUser:
    fullname: A User
    createhome: True
    sudouser: True
    sudo_rules:
      - ALL=(ALL) NOPASSWD:ALL
    ssh_auth:
      - <redacted>
    gitconfig:
      user.name: A User
      user.email: <redacted>

Running salt-call state.apply users -l info results in the contents of this pastebin (last bit only shown) https://pastebin.com/prne7Xn2

garethhowell commented 5 years ago

This appears to only fail if the latest dev version of the minion is installed. with 2019.2.0-751-g3593c91 installed, I get the error. If I roll back to 2019.2.0 it works

myii commented 5 years ago

Thanks for reporting this @garethhowell. I'm reopening this since something will need to be done about this at some point. It will be replaced by usergroup. Some references:

garethhowell commented 5 years ago

Ahah Now it makes sense :-)

Gareth Howell gareth.howell@gmail.com

On 22 May 2019, at 20:06, Imran Iqbal notifications@github.com wrote:

Thanks for reporting this @garethhowell https://github.com/garethhowell. I'm reopening this since something will need to be done about this at some point. It will be replaced by usergroup. Some references:

saltstack/salt#48704 https://github.com/saltstack/salt/pull/48704 Upstream PR which makes the change. https://docs.saltstack.com/en/latest/ref/states/all/salt.states.user.html#salt.states.user.present https://docs.saltstack.com/en/latest/ref/states/all/salt.states.user.html#salt.states.user.present: gid_from_name present but not usergroup. https://docs.saltstack.com/en/develop/ref/states/all/salt.states.user.html#salt.states.user.present https://docs.saltstack.com/en/develop/ref/states/all/salt.states.user.html#salt.states.user.present usergroup present but not gid_from_name. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/saltstack-formulas/users-formula/issues/198?email_source=notifications&email_token=AAEQKNVORVNMRTZQSPLOI63PWWKTTA5CNFSM4HJCIWBKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODV776AY#issuecomment-494927619, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEQKNRHSLJW6NQDTMF5RIDPWWKTTANCNFSM4HJCIWBA.

myii commented 5 years ago

@garethhowell The solution that @dafyddj captured in https://github.com/saltstack-formulas/vault-formula/pull/35#issuecomment-509854411 is much better than messing around with gid_from_name and usergroup, depending on the Salt version. I'll get around to putting this in a PR soon.

garethhowell commented 5 years ago

Thanks for the update.