I have a shell script that is designed to run “virsh domifaddr | grep ipv4 | awk ‘{print $4}’” on the remote host. From my ansible controller, the playbook calls this piece:
name: Find out the IP address of ucloud_vm_name
script: /root/mltr_source_code/compute_ucloud_vm_ip.sh {{ ucloud_vm_name }}
Could you please provide -vvvv log for your playbook run ? Without that information it is very difficult to know what is wrong. I would recommend you to add more debugging statements in shell script before running via Ansible. btw, I see domain name hardcoded at “domifaddr” line (is that expected ?).