Hello, I am using custom module and looping through items to do "kubectl apply -f".
- name: create rbac objects kubectl: manifest: "{{ item }}" state: present with_fileglob: "{{ CAAS.rbac_manifests_directory }}/*" register: rbacresult failed_when: '"v1beta1 is deprecated" not in rbacresult.results[0].stdout' tags: rbac Here it fails with, fatal: [localhost]: FAILED! => {"msg": "The conditional check 'v1beta1 not in rbacresult.results[0].stdout' failed. The error was: error while evaluating conditional (v1beta1 not in rbacresult.results[0].stdout): Unable to look up a name or access an attribute in template string ({% if v1beta1 not in rbacresult.results[0].stdout %} True {% else %} False {% endif %}).\nMake sure your variable name does not contain invalid characters like '-': argument of type 'AnsibleUndefined' is not iterable"} It would be nice, if I could loop through complete result variable and then fail only if "not of my specific-condition". -- You received this message because you are subscribed to the Google Groups "Ansible Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-devel/25b09124-2a06-47f6-927b-46c5c0ac03cfn%40googlegroups.com.