Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {% set dev = "dev" %}
- {% set prod = "prod" %}
- {% set vars = {'isLocal': False} %}
- {% for ip in salt['grains.get']('ipv4') if ip.startswith('10.255.255') -%}
- {% if vars.update({'isLocal ': True}) %} {% endif %}
- {% endfor %}
- {% if vars.isLocal == "true" %}
- {{ dev }}
- {% else %}
- {{ prod }}
- {%- endif %}
- ENDS UP WITH
- [root@web_server tmp]# salt-call state.sls test
- [INFO ] Loading fresh modules for state activity
- [CRITICAL] Rendering SLS "base:test" failed: Illegal tab character; line 9
- ---
- [...]
- - name: /tmp/test_jinja.txt
- - contents: |
- <======================
- prod
- ---
- local:
- Data failed to compile:
- ----------
- Rendering SLS "base:test" failed: Illegal tab character; line 9
- ---
- [...]
- - name: /tmp/test_jinja.txt
- - contents: |
- <======================
- prod
- ---
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement