salt icon indicating copy to clipboard operation
salt copied to clipboard

[BUG] config.item master returns a changed value in a multi-master setup

Open erwindon opened this issue 3 years ago • 2 comments
trafficstars

Description Api call config.item returns the given config value from a minion. In a multi-master setup, variable master contains a list of addresses. However, config.item master returns only one value, instead of the whole list.

Setup Use two salt-masters. Use one salt-minion that is configured to use both salt-masters.

  • [ ] on-prem machine
  • [X] VM (Virtualbox)
  • [ ] VM running on a cloud service, please be explicit and add details
  • [ ] container (Kubernetes, Docker, containerd, etc. please specify)
  • [ ] or a combination, please be explicit
  • [ ] jails if it is FreeBSD
  • [ ] classic packaging
  • [ ] onedir packaging
  • [ ] used bootstrap to install

Steps to Reproduce the behavior issue command config.item master to retrieve the value for variable master from the minion.

Expected behavior The expected return value is the configured value (not an updated value).

Versions Report

salt --versions-report
Salt Version:
          Salt: 3005
 
Dependency Versions:
          cffi: Not Installed
      cherrypy: unknown
      dateutil: 2.8.1
     docker-py: Not Installed
         gitdb: 4.0.5
     gitpython: 3.1.14
        Jinja2: 2.11.3
       libgit2: Not Installed
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.0
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: Not Installed
      pycrypto: Not Installed
  pycryptodome: 3.9.7
        pygit2: Not Installed
        Python: 3.9.2 (default, Feb 28 2021, 17:03:44)
  python-gnupg: Not Installed
        PyYAML: 5.3.1
         PyZMQ: 20.0.0
         smmap: 4.0.0
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.3.4
 
System Versions:
          dist: debian 11 bullseye
        locale: utf-8
       machine: x86_64
       release: 5.10.0-18-amd64
        system: Linux
       version: Debian GNU/Linux 11 bullseye

erwindon avatar Sep 17 '22 23:09 erwindon

thats semi intended behvaior, master is the current master that minion object is connected to. use master_list to get the original set of masters

mattp- avatar Sep 19 '22 19:09 mattp-

@mattp-

thats semi intended behvaior, master is the current master that minion object is connected to.

that was also my guess, but that behaviour is also undocumented. but I would be happy with any alternative...

use master_list to get the original set of masters

master_list is not returned by config.items, nor is it retrievable using config.get or config.option. from the source code, it looks like master_list is only an internal variable in the minion. can you give a more complete example please?

erwindon avatar Sep 20 '22 00:09 erwindon