There was code that was overriding the value of `auth_timeout` regardless
of what was set in the configuration. It was overriding it to be 5
seconds. Although 5 seconds is sufficient for most cases, in testing, I
have found it insufficient for the following use case (running both
Windows master and minions):
1) Start salt-master
2) Start salt-minion
3) Stop salt-master
4) Start salt-master
The minion reconnect will timeout after step 4. Due to this, we set the
`auth_timeout` to be 15 seconds in our own configuration file. However,
due to this issue, that configuration value was ignored and thus we
fail on reconnects.
`salt/minion.py`:
- Don't hard-code the `auth_timeout` to 5 seconds. Use the user configured
value (or the default value if the user didn't configure a value).
`salt/config/__init__.py`:
- Made the default be 5 seconds for `auth_timeout` instead of 60. Chose 5
seconds because this is the current hard-coded behavior.
Signed-off-by: Sergey Kizunov <sergey.kizunov@ni.com>
The try/except block is indented to handle AttributeErrors if the routine `get_<tgt_type>` is not available. But since the actual function call is also wrapped in the block if the routine is actually implemented but raises an AttributeError that one is catched too (which I think is unintentional).
This patch moves the function call out of the try/except block to not mask AttributeErrors happening within the called routine.
This is to resolve#35422. The "install_recommends" flag in the SLS file
would apply --no-install-recommends to false, but if set to True it
would not enforce --install-recommends. It should not be assumed that
apt will install the recommends packages, since that can be disabled
globally.
https://github.com/saltstack/salt/issues/35422
service checks.
The function "agent_service_register" in the consul.py module failed
to register service health checks and did not follow the consul.io
documentation for doing so. This patch fixes the code to successfully
register service checks, check for dict keys case-insensitive (because
the absense of keys with the correct case would fail silently), and
more closely follow the documentation at consul.io, see:
https://www.consul.io/docs/agent/http/agent.html#agent_service_register
Here is an example salt state for registering a service and a couple
of health checks, similar to the example in the consul.io documents:
example-service-registration:
module.run:
- name: consul.agent_service_register
- consul_url: "http://localhost:8500"
- kwargs:
id: redis1
name: "redis"
tags: [master, v1]
address: "127.0.0.1"
port: 8000
EnableTagOverride: false
check:
script: "/usr/local/bin/check_redis.py"
http: "http://localhost:5000/health"
interval: "15s"
NOTE: the saltstack documentation needs to be updated. It wasn't
correct anyway.