Could not able to run Multiple Plays.

Hi Team,

I am able to execute a single play in the play book.

But i am not able to execute the second play in the playbook.

Getting the Below error:-

ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.

The error appears to have been in ‘/opt/work/ansible/playbooks/gowtham/vm_deploy.yml’: line 55, column 5, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

tasks:

  • name: Deploying Second VM
    ^ here

Source Code here

this is happening because you have an extra dash

<snip>

  tasks:
  - name: Deploying Second VM
  - vmware_guest:
       hostname: "{{vspheredetails.hostname}}"

</snip>

Make it look like this

  tasks:
  - name: Deploying Second VM
    vmware_guest:
       hostname: "{{vspheredetails.hostname}}"

The name names the task. The vmware_guest is the module used in the task

-tim

Thank you Let me check it.