salt
salt copied to clipboard
'defaults.merge' is not available when using `salt-ssh`
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:
- https://github.com/saltstack-formulas/redis-formula/issues/75#issuecomment-459667105
- https://github.com/saltstack-formulas/openssh-formula/pull/151#issuecomment-462866903
[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:
- https://github.com/orgs/saltstack-formulas/projects/1
- https://github.com/saltstack-formulas/template-formula/issues/21
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.
looks like i'm able to replicate this error running the following:
-
cd /srv/salt
-
git clone https://github.com/saltstack-formulas/redis-formula.git .
-
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
@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:
- https://github.com/saltstack-formulas/redis-formula/issues/75#issuecomment-459279282
- https://github.com/saltstack-formulas/redis-formula/issues/75#issuecomment-459281665
For anyone stumbling on this: You can use slsutil.merge
to do exactly the same thing.
@yuriks Thanks for sharing that. Actually, we've got an active PR that proposes the same thing:
- https://github.com/saltstack-formulas/template-formula/pull/186
@yuriks looks like slsutil.merge isn't working in the salt-ssh situation too
just got bit by this as well.