-
Notifications
You must be signed in to change notification settings - Fork 5.5k
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Salt master not properly generating the map #22241
Comments
That versions-report stacktrace is weird. How did you install the master? Seems like we should get that resolved, because you may have something weird going on with your install.
Do the rest of the values get set correctly? As in, are those the only things missing, but the rest of
Can you clarify? What are you doing differently? The map should still execute on the minion side as part of a state run or whatever. |
@BaseApi I installed salt-master with the salt-bootstrap script then just
Yes, these are the only 2 values that do not work for some reason.
salt "mynodename" state.sls sensu.client |
After more experimentation. I think there is some pillar data problem that is overriding the features some. I am using yamlex to merge some pillar data after a few tries I am seeing what the problem seems to reside. Client state: #!yamlex
sensu:
client:
subscriptions: !aggregate
- all
rabbitmq:
host: "123.456.789.123"
password: "password"
port: 5672
user: "user"
vhost: "/vhost" This pillar data would be present on all minions. The are groups like so: #!yamlex
sensu:
client:
subscriptions: !aggregate
- mygroup On the "mynode*":
- sensu/groups/mygroup1
- sensu/groups/mygroup2 Different behaviour occurs on the following situations:
|
Hrm, I don't know yamlex well enough to know whether there's a bug here or not off the top of my head. But thanks for your good detective work, at least we'll know where to look when we find time to dive into this one. |
ping |
I have to admit this is not very high priority for us at the moment, @masterkorp. Not very many users are trying to do complex merging with yamlex like this, and we have a lot of bugs which are affecting many users. Just wanted to manage expectations. Sorry for the inconvenience this is causing. |
@basepi Thanks for the explanation. I don't mind getting my hands on this. If I can get some guidance on the problem. |
There's a number of places where the merging happens, like this one: https://github.com/saltstack/salt/blob/develop/salt/pillar/__init__.py#L445-L449 It's possible we need a new merging strategy or something. The fix may be in the file I linked above or in https://github.com/saltstack/salt/blob/develop/salt/utils/dictupdate.py |
@basepi @masterkorp I just tested out the following additions to I am not using the yamlex renderer, but defaulting to smart renderer and this test worked out fine. Thoughts? Worth a PR? def update(dest, upd):
for key, val in six.iteritems(upd):
try:
if isinstance(val, OrderedDict):
klass = OrderedDict
elif isinstance(val, list):
klass = list
else:
klass = dict
dest_subkey = dest.get(key, klass())
except AttributeError:
dest_subkey = None
if isinstance(dest_subkey, collections.Mapping) \
and isinstance(val, collections.Mapping):
ret = update(dest_subkey, val)
dest[key] = ret
elif isinstance(dest_subkey, list) \
and isinstance(val, list):
dest[key] = dest.get(key, []) + val
elif key:
dest[key] = upd[key]
return dest |
👍 Will test this soon! |
@masterkorp - let me know if it works, and i'll put in a PR. I ran into the same issue trying to merge subscription lists for sensu amongst different pillars as I wanted my pillars to be "modular" when including different subscriptions for different host roles. |
@masterkorp - I finally got around to making a PR for this. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue. |
I have the following map.jinja on a formula
The
sensu["name"]
andsensu["address"]
do not get set when using salt from a salt-master. While testing with salt-call and kitchen-salt they get they proper value just fine.Both on the salt masterless, the minions and the master are on
Helium
above go the detailed versions-reportTest box: Always built from scratch
The minions:
The master: --versions-report is breaking
The text was updated successfully, but these errors were encountered: