Rendering SLS error, what am I not seeing

1,055 views
Skip to first unread message

moop-moop

unread,
Apr 28, 2016, 10:17:12 PM4/28/16
to Salt-users
I can't figure out what the problem is, YAML or misunderstanding the SaltStack documentation etc. I have not enabled debugging yet.
This is on a Windows minion.

snippet from the state file that is causing the error:

set grain for {{instance_env_name}}Tomcat7{{instance_name}}:
  grains.append:
    - name: tomcat7:services
      - value: '{{instance_env_name}}Tomcat7{{instance_name}}'
    - require:
      - service: start tomcat service {{instance_env_name}}Tomcat7{{instance_name}}

Error:
- Rendering SLS win_tomcat7.configure-instances failed, render error: while parsing a block mapping
        in "<unicode string>", line 109, column 7:
              - name: tomcat7:services
                ^
      expected <block end>, but found '-'
        in "<unicode string>", line 110, column 7:
                - value: 'prodTomcat7pat-delivery'
                ^
      Traceback (most recent call last):
        File "c:\salt\bin\lib\site-packages\salt\state.py", line 2672, in render_state
          sls, rendered_sls=mods
        File "c:\salt\bin\lib\site-packages\salt\template.py", line 95, in compile_template
          ret = render(input_data, saltenv, sls, **render_kwargs)
        File "c:\salt\bin\lib\site-packages\salt\renderers\yaml.py", line 51, in render
          data = load(yaml_data, Loader=get_yaml_loader(argline))
        File "c:\salt\bin\lib\site-packages\yaml\__init__.py", line 71, in load
          return loader.get_single_data()
        File "c:\salt\bin\lib\site-packages\yaml\constructor.py", line 37, in get_single_data
          node = self.get_single_node()
        File "c:\salt\bin\lib\site-packages\yaml\composer.py", line 36, in get_single_node
          document = self.compose_document()
        File "c:\salt\bin\lib\site-packages\yaml\composer.py", line 55, in compose_document
          node = self.compose_node(None, None)
        File "c:\salt\bin\lib\site-packages\yaml\composer.py", line 84, in compose_node
          node = self.compose_mapping_node(anchor)
        File "c:\salt\bin\lib\site-packages\yaml\composer.py", line 133, in compose_mapping_node
          item_value = self.compose_node(node, item_key)
        File "c:\salt\bin\lib\site-packages\yaml\composer.py", line 84, in compose_node
          node = self.compose_mapping_node(anchor)
        File "c:\salt\bin\lib\site-packages\yaml\composer.py", line 133, in compose_mapping_node
          item_value = self.compose_node(node, item_key)
        File "c:\salt\bin\lib\site-packages\yaml\composer.py", line 82, in compose_node
          node = self.compose_sequence_node(anchor)
        File "c:\salt\bin\lib\site-packages\yaml\composer.py", line 111, in compose_sequence_node
          node.value.append(self.compose_node(node, index))
        File "c:\salt\bin\lib\site-packages\yaml\composer.py", line 84, in compose_node
          node = self.compose_mapping_node(anchor)
        File "c:\salt\bin\lib\site-packages\yaml\composer.py", line 127, in compose_mapping_node
          while not self.check_event(MappingEndEvent):
        File "c:\salt\bin\lib\site-packages\yaml\parser.py", line 98, in check_event
          self.current_event = self.state()
        File "c:\salt\bin\lib\site-packages\yaml\parser.py", line 439, in parse_block_mapping_key
          "expected <block end>, but found %r" % token.id, token.start_mark)
      ParserError: while parsing a block mapping
        in "<unicode string>", line 109, column 7:
              - name: tomcat7:services
                ^
      expected <block end>, but found '-'
        in "<unicode string>", line 110, column 7:
                - value: 'prodTomcat7pat-delivery'
                ^
ERROR: Minions returned with non-zero exit code


Nicholas Capo

unread,
Apr 28, 2016, 10:23:16 PM4/28/16
to Salt-users

I'm pretty sure that '  - value' needs to be at the same indentation level as name.

Hope that helps,

Nicholas


--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thomas Phipps

unread,
Apr 28, 2016, 10:43:35 PM4/28/16
to salt-...@googlegroups.com
- value is at the wrong indent level. however the : in tomcat7:services is also throwing the yaml into a tizzy. 

--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Thomas Phipps
Linux/Openstack/Logstash

Reply all
Reply to author
Forward
0 new messages