Ansible: Localizando um texto na saída de um comando
Ao executar comando o output informa se ocorreu com Sucesso (INSTCONFSUCCESS) ou Falha (INSTCONFFAILED).
Através do comando find, identifico o texto.
- name: "Create Was Profile"
command: "/opt/IBM/WebSphere/AppServer/bin/manageprofiles.sh -response arquivo.rsp"
register: cout
changed_when: ( cout.stdout.find('INSTCONFSUCCESS') != -1)
failed_when: ( cout.stdout.find('INSTCONFFAILED') != -1)