Advertisement
Guest User

Untitled

a guest
Jan 20th, 2015
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. --- the defaults.yaml
  2. {% load_yaml as rawmap %}
  3. Debian:
  4. common:
  5. timezone:
  6. managed: True # Set to False to ignore this "module"
  7. name: "Europe/Berlin"
  8. utc: True
  9. {% endload %}
  10.  
  11. --- the SLS
  12. #!jinja|yaml
  13. #
  14. # Copy of https://github.com/bechtoldt/saltstack-time-formula/blob/master/time/init.sls
  15. #
  16.  
  17. {% from "common/defaults.yaml" import rawmap with context %}
  18. {% set datamap = salt['grains.filter_by'](rawmap, merge=salt['pillar.get']('common:lookup')) %}
  19.  
  20. {% if datamap.timezone.managed %}
  21. systimezone:
  22. timezone:
  23. - system
  24. - name: {{ datamap.timezone.name }}
  25. - utc: {{ datamap.timezone.utc }}
  26. {% endif %}
  27.  
  28. --- the error:
  29. saltmaster.pcdummy.lan:
  30. Data failed to compile:
  31. ----------
  32. Rendering SLS 'base:common.timezone' failed: Jinja variable 'dict object' has no attribute 'timezone'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement