1

I am trying to assign a json file to a variable inside loop in ansible using --set-string and then run helm upgrade command. But it gives -

This command needs 2 arguments: release name, chart path\nError: plugin \"tiller\" exited with error" error.

  {% for file in v.value.files %}
  --set-string config[{{ loopOut.index0 }}].files[{{ loop.index0 }}].name={{ file }}
  {% set args = args|combine(v.value.args) %}
  --set-string config[{{ loopOut.index0 }}].files[{{ loop.index0 }}].value=
  {{ lookup('file','../files/initData.json')| from_json }}
  {% endfor %}

where loopOut is outer loop variable inside which I have this current loop. What am I doing wrong here? I even tried to put

 "{{ lookup('file','../files/initData.json')| from_json }}" in quotes

But this also does not help.

supriya
  • 895
  • 1
  • 8
  • 18
  • What is the end command that is fed to `helm`, because your error message makes it seem like you provided `--set-string` options but left off the chart name – mdaniel Apr 06 '19 at 17:30

0 Answers0