State in SLS is not formed as a list
See original GitHub issueWhat can be wrong here? It work ok, when i try to hardcode state
State:
{% for service, args in pillar.get('xml',{}).items() %}
{{ service }}:
ensure_value_true:
xml.value_present:
- name: {{ args['name'] }}
- xpath: {{ args['xpath'] }}
- value: {{ args['value'] }}
{% endfor %}
Pillar:
xml:
MqHostName:
value: 'mq.ext'
xpath: './/MqHostName'
name: 'C:\\PFEI\ExternalMqService\Configs\MqSettings.Ext.xml'
MqPort:
value: '2911'
xpath: 'MqPort'
name: 'C:\\PFEI\ExternalMqService\Configs\MqSettings.Ext.xml'
Error:
Data failed to compile:
----------
State 'MqHostName' in SLS 'xml' is not formed as a list
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
State in SLS file is not formed as a list - Stack Overflow
The salt-master is running on an Ubuntu box and the key is accepted. I'm new to salt! I've just put it through an...
Read more >Getting state in sls is not formed as a list · Issue #21802 - GitHub
The reason being that your /var/www/kibana line, the way you have it, isn't formed as a list like the archive.extracted state is. If...
Read more >The state "apache" in sls user-fix is not formed as a list
The state "apache" in sls user-fix is not formed as a list here is my init.sls file apache: pkg.installed: {% if grains['os'] ==...
Read more >Cannot figure out how to use a formula without receiving 'The ...
Cannot figure out how to use a formula without receiving 'The state "formula" in sls formula is not formed as a list'. 775...
Read more >How Do I Use Salt States? - Salt Project Documentation
The core of the Salt State system is the SLS, or SaLt State file. ... SLS files are therefore, in reality, just dictionaries,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Good @Morozzko so this new error is just minor. Use state name
ensure_value_true_{{ service }}:
to avoid ID name collisions inside for loop. This is not salt issue just Jinja convention.Try the following command to troubleshoot just the Jinja statements without evaluating the resulting Yaml:
salt MINION slsutil.renderer default_renderer=jinja path=salt://xml.sls