ansible 2 - failed_when as a list

254 views
Skip to first unread message

ProfHase

unread,
Jan 14, 2016, 8:04:42 AM1/14/16
to Ansible Project


- name: install it
  become
: True
 
register: command_result
  shell
:
   
./my_install
    chdir
=/tmp/setup
  failed_when
:
   
- "'already installed' not in command_result.stdout"
   
- "command_result.rc != 0"


fails with the following message:


 The field 'failed_when' is supposed to be a string type, however the incoming data structure is
 a <class 'ansible.parsing.yaml.objects.AnsibleSequence'>

In ansible 1.8 this playbook worked. Is there a new feature which replaced the list in ``failed_when``?

Brian Coca

unread,
Jan 14, 2016, 6:44:09 PM1/14/16
to Ansible Project
no, this is a bug, failed_when, like all conditionals should take a
string or a list of strings


--
Brian Coca

ProfHase

unread,
Jan 15, 2016, 5:36:59 AM1/15/16
to Ansible Project
Thanks, I opened an issue for it
Reply all
Reply to author
Forward
0 new messages