Makes sense the behavior, your playbook is attempting to power on the vm (state: poweredon) if the vm is already powered on then changed should be false.
Sorry I put another version of the playbook.
It doesnt work vmware vguest module to start or stop a virtual machine.
- name: Start vmware MV
vmware_guest:
hostname: xxxx
username: xxxx
password: xxx
validate_certs: no
name: {{server}}
state: poweredoff
delegate_to: localhost
register: vmware_start
The problem is the user that I use.
I change the user with more privileges and go OK.
ok: [ssh.sva.itbatera.ejgv.eus] => {
“vmware_start”: {
“changed”: true,
“failed”: false
}