Hi

How can I avoid that the template engine throws this error ?

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


Error

  fatal: [10.8.244.145]: FAILED! => {"failed": true, "msg": "template error 
while templating string: 
  
  unexpected '.'. String: /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 -"}


Regards

Charles

-- 
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/7951dbe7-fef5-4a23-a467-c49ce3e0f609%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to