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

[BUG] 'gid_from_name' is an invalid keyword argument for 'user.present' #39

Closed
ShaunMaher opened this issue Jul 15, 2020 · 1 comment · Fixed by #40
Closed

[BUG] 'gid_from_name' is an invalid keyword argument for 'user.present' #39

ShaunMaher opened this issue Jul 15, 2020 · 1 comment · Fixed by #40
Labels

Comments

@ShaunMaher
Copy link

Your setup

Formula commit hash / release tag

Using the latest commit at time of writing: d4c849a

Versions reports (master & minion)

The Salt master is version 3000.3 and the minion is 3001. From the master:

Salt Version:
           Salt: 3000.3
 
Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.6.1
      docker-py: Not Installed
          gitdb: 2.0.3
      gitpython: 2.1.8
         Jinja2: 2.10
        libgit2: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 3.6.9 (default, Apr 18 2020, 01:56:04)
   python-gnupg: 0.4.1
         PyYAML: 3.12
          PyZMQ: 16.0.2
          smmap: 2.0.3
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: 4.2.5
 
System Versions:
           dist: Ubuntu 18.04 bionic
         locale: UTF-8
        machine: x86_64
        release: 5.4.0-40-generic
         system: Linux
        version: Ubuntu 18.04 bionic

Pillar / config used

I'm basically using the example pillar data. I'm just starting out and don't know what I want yet. :-)

etcd:
  version: 3.2.24
  arch: {{ grains["osarch"] }}
  prefix: /usr/local
  realhome: /usr/local/etcd-v3.2.24-linux-{{ grains["osarch"] }}
  user: etcd
  use_upstream_repo: true
  service:
    name: etcd0
    data_dir: /var/lib/etcd/etcd0
    initial_cluster: 'etcd0=https://0.0.0.0:2380'
    initial_cluster_state: new
    initial_cluster_token: etcd-cluster-1
    initial_advertise_peer_urls: 'https://0.0.0.0:2380'
    listen_peer_urls: 'https://0.0.0.0:2380'
    listen_client_urls: 'https://0.0.0.0:2379'
    advertise_client_urls: 'https://0.0.0.0:2379'
    cert_file: /etc/ssl/etcd/ca.pem
    key_file: /etc/ssl/etcd/client.pem
    ca_file: /etc/ssl/etcd/client-key.pem
    cmd_args: '--auto-tls --peer-auto-tls'
    auto_tls: True
    peer_auto_tls: True

Bug details

Describe the bug

It seems that the use of "gid_from_name" in the context of "user.present" has been replaced with "usergroup" in the latest (3001) version of SaltStack. The state provided here in "etcd/install.sls" uses the older "gid_from_name" (line 19). This causes the state to fail to apply. The resulting error is:

ERROR executing 'state.apply': 'gid_from_name' is an invalid keyword argument for 'user.present'

Steps to reproduce the bug

Expected behaviour

Applying the state should work.

Attempts to fix the bug

I have forked this repo and changed line 19 in "etcd/install.sls" to read:

    - usergroup: True

I then removed the "group.present" stanza. usergroup: True automatically creates the group but if the group already exists, it fails to create the user. Then I removed a few requires that were looking for the "group.present" that I removed.

My version can be found here: https://github.com/ShaunMaher/etcd-formula/blob/master/etcd/install.sls

This resolves the issue but, I'm not sure if this will break older versions of Salt.

Additional context

@ShaunMaher ShaunMaher added the bug label Jul 15, 2020
@myii
Copy link
Member

myii commented Jul 15, 2020

Thanks for the report, @ShaunMaher. This has come up elsewhere:

Our method for dealing with it is linked in one of the comments there:

You can also see some of the commits that were added to other formulas after that comment. Would you mind doing proposing the same thing in a PR for this formula?

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

Successfully merging a pull request may close this issue.

2 participants