Attempt at configuring a list of yum groupinstalled packages

7 views
Skip to first unread message

NM

unread,
Aug 24, 2022, 11:35:35 AMAug 24
to Salt-users
I am trying to configure a standard yum groupinstall via SALT but I am getting the error: "TypeError: LoadedFunc object got multiple values for keyword argument 'pkgs'"

What I have set up so far:
salt state:
{% from "workstation/map.jinja" import pkglist with context %}

{%- for package in pkglist.group_add %}
{{ package }}:
  pkg.group_installed:
    - pkgs: "{{ package }}"
{% endfor %}

in map.jinja:
{% set pkglist = salt['grains.filter_by']({
    'CentOS Linux-7': {
        'group_add': [
             "Server with GUI",
             "System Management",
         ],
    },

}, grain='osfinger',
) %}

Result for a missing, as well as a pre-existing group install:
          ID: Server with GUI
    Function: pkg.group_installed
      Result: False
     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "/usr/lib/python3.6/site-packages/salt/state.py", line 2180, in call
                  *cdata["args"], **cdata["kwargs"]
                File "/usr/lib/python3.6/site-packages/salt/loader/lazy.py", line 149, in __call__
                  return self.loader.run(run_func, *args, **kwargs)
                File "/usr/lib/python3.6/site-packages/salt/loader/lazy.py", line 1201, in run
                  return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
                File "/usr/lib/python3.6/site-packages/contextvars/__init__.py", line 38, in run
                  return callable(*args, **kwargs)
                File "/usr/lib/python3.6/site-packages/salt/loader/lazy.py", line 1216, in _run_as
                  return _func_or_method(*args, **kwargs)
                File "/usr/lib/python3.6/site-packages/salt/loader/lazy.py", line 1249, in wrapper
                  return f(*args, **kwargs)
                File "/usr/lib/python3.6/site-packages/salt/states/pkg.py", line 3450, in group_installed
                  ret["changes"] = __salt__["pkg.install"](pkgs=targets, **kwargs)
              TypeError: LoadedFunc object got multiple values for keyword argument 'pkgs'
     Started: 22:40:52.623089
    Duration: 7542.382 ms
     Changes:
----------
          ID: System Management
    Function: pkg.group_installed
      Result: True
     Comment: Group 'System Management' is already installed
     Started: 22:41:00.165749
    Duration: 196.419 ms
     Changes:

When the package is installed- it works as I would expect... but when the group is missing... I get "TypeError: LoadedFunc object got multiple values for keyword argument 'pkgs'".

Any thoughts?


Reply all
Reply to author
Forward
0 new messages