Public bug reported:

example user-data file with jinja

## template: jinja
#!/bin/sh

{% set data_result = [] %}
{% set data_input = [1,2,3] %}
{% for i in data_input %}
  {% do data_result.append(i) %}
{% endfor %}
echo results: {{data_result}} >>results.out


The following exception is thrown when using jinja2 'do' statement.

jinja2.exceptions.TemplateSyntaxError: Encountered unknown tag 'do'.
Jinja was looking for the following tags: 'endfor' or 'else'. The
innermost block that needs to be closed is 'for'.

I'm using cloud-init from a 64bitencoded file passed into terraform
azure provider custom_data.

** Affects: cloud-init
     Importance: Undecided
         Status: New

** Attachment added: "cloud-init logs"
   
https://bugs.launchpad.net/bugs/1962759/+attachment/5565034/+files/cloud-init.tar.gz

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1962759

Title:
  jinja-template doesn't support 'do' extension.

Status in cloud-init:
  New

Bug description:
  example user-data file with jinja

  ## template: jinja
  #!/bin/sh

  {% set data_result = [] %}
  {% set data_input = [1,2,3] %}
  {% for i in data_input %}
    {% do data_result.append(i) %}
  {% endfor %}
  echo results: {{data_result}} >>results.out

  
  The following exception is thrown when using jinja2 'do' statement.

  jinja2.exceptions.TemplateSyntaxError: Encountered unknown tag 'do'.
  Jinja was looking for the following tags: 'endfor' or 'else'. The
  innermost block that needs to be closed is 'for'.

  I'm using cloud-init from a 64bitencoded file passed into terraform
  azure provider custom_data.

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1962759/+subscriptions


-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to