saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:
https://repo.saltproject.io/
Apache License 2.0
14.06k stars 5.47k forks source link

'defaults.merge' is not available when using `salt-ssh` #51605

Open myii opened 5 years ago

myii commented 5 years ago

Description of Issue/Question

SaltStack-Formulas has started to adopt using defaults.merge in map.jinja, for example in the salt-formula.

There are now two reports that this isn't working when using salt-ssh. Both with the same error:

[DEBUG   ] Could not LazyLoad defaults.merge: 'defaults.merge' is not available.

This is an unfortunate development, since we're making a concerted effort to improve the quality and usefulness of SaltStack-Formulas in general. For reference:

Setup

The redis-formula issue has full details.

Steps to Reproduce Issue

Covered in the issue above.

Versions Report

Covered in the issue above. Also supplied in the openssh-formula pull comment.

Ch3LL commented 5 years ago

looks like i'm able to replicate this error running the following:

  1. cd /srv/salt
  2. git clone https://github.com/saltstack-formulas/redis-formula.git .
  3. salt-ssh '*' state.sls redis test=True -ltrace > /tmp/test 2>&1

and i see - Rendering SLS 'base:redis.common' failed: Jinja variable 'dict object' has no attribute 'pkg_name'

looks like we need to get this fixed up thanks

myii commented 5 years ago

@Ch3LL Thanks for the review and confirmation.

and i see - Rendering SLS 'base:redis.common' failed: Jinja variable 'dict object' has no attribute 'pkg_name'

Yes, as a symptom of the merge not taking place, the other YAML files are not merged into the map, leading to missing attributes as shown in the following two comments:

yuriks commented 4 years ago

For anyone stumbling on this: You can use slsutil.merge to do exactly the same thing.

myii commented 4 years ago

@yuriks Thanks for sharing that. Actually, we've got an active PR that proposes the same thing:

vincentor commented 4 years ago

@yuriks looks like slsutil.merge isn't working in the salt-ssh situation too

nergdron commented 2 years ago

just got bit by this as well.