Json parsing in Ansible There are quite a bit of helpful filters in Ansible. Try: when: (output_text.stdout | from_json).ismaster