On 27. okt. 2017 17:56, [email protected] wrote: > Hi > > How can I avoid that the template engine throws this error ?
Don't use . in variable name. https://docs.ansible.com/ansible/latest/playbooks_variables.html#what-makes-a-valid-variable-name > Task > > - name: Get Service Account Token > shell: | > /usr/local/bin/oc get sa/jenkins -n {{ namespace }} --template='{{range > .secrets}}{{ .name }} {{end}}' | xargs -n 1 oc get secret --template='{{ if > .data.token }}{{ .data.token }}{{end}}' | head -n 1 | base64 -D - > register: sa_jenkins_token This looks very strange and I don't understand what you are trying to do. {{ }} is only used for variables not Jinja logic. -- Kai Stian Olstad -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/29725856-74a8-da1e-5843-000d7d7f0f9e%40olstad.com. For more options, visit https://groups.google.com/d/optout.
