Advertisement
Guest User

Untitled

a guest
Apr 30th, 2014
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. {% set dev = "dev" %}
  2. {% set prod = "prod" %}
  3. {% set vars = {'isLocal': False} %}
  4. {% for ip in salt['grains.get']('ipv4') if ip.startswith('10.255.255') -%}
  5. {% if vars.update({'isLocal ': True}) %} {% endif %}
  6. {% endfor %}
  7. {% if vars.isLocal == "true" %}
  8. {{ dev }}
  9. {% else %}
  10. {{ prod }}
  11. {%- endif %}
  12.  
  13.  
  14.  
  15. ENDS UP WITH
  16.  
  17.  
  18. [root@web_server tmp]# salt-call state.sls test
  19. [INFO ] Loading fresh modules for state activity
  20. [CRITICAL] Rendering SLS "base:test" failed: Illegal tab character; line 9
  21.  
  22. ---
  23. [...]
  24. - name: /tmp/test_jinja.txt
  25. - contents: |
  26.  
  27.  
  28.  
  29. <======================
  30.  
  31.  
  32. prod
  33.  
  34.  
  35. ---
  36. local:
  37. Data failed to compile:
  38. ----------
  39. Rendering SLS "base:test" failed: Illegal tab character; line 9
  40.  
  41. ---
  42. [...]
  43. - name: /tmp/test_jinja.txt
  44. - contents: |
  45.  
  46.  
  47.  
  48. <======================
  49.  
  50.  
  51. prod
  52.  
  53.  
  54. ---
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement