I need to check status of VMware tools on vms & if VMware tools are not running, then reboot the vm. I have below playbook which works fine to find vm name & VMware tools status. Please help on how can i extract the vm name & take action as per status.
Note : i have to use the VMware modules as the OS typically will be in hung status ( hence tools not running ) , hence avoid user OS level task ( and use VMware task )
why is it when i run this playbook I get this error
tony@ubuntu:~/ansiblework$ ansible-playbook vmware_tools.yml
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match ‘all’
ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.
The error appears to be in ‘/home/tony/ansiblework/vmware_tools.yml’: line 9, column 5, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
tasks:
name: Get information about the virtual machine
^ here
what editor can i use on my ubuntu box? I cant use anything other than vim.
still getting the error.
tony@ubuntu:~/ansiblework$ ansible-playbook info.yml
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match ‘all’
ERROR! Syntax Error while loading YAML.
mapping values are not allowed in this context
The error appears to be in ‘/home/tony/ansiblework/info.yml’: line 3, column 8, but may
be elsewhere in the file depending on the exact syntax problem.
tony@ubuntu:~/ansiblework$ ansible-playbook vmware_tools.yml
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match ‘all’
ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.
The error appears to be in ‘/home/tony/ansiblework/vmware_tools.yml’: line 7, column 5, but may
be elsewhere in the file depending on the exact syntax problem.
tony@ubuntu:~/ansiblework$ ansible-playbook vmware_tools.yml
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.
The error appears to be in '/home/tony/ansiblework/vmware_tools.yml': line 7, column 5, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
tasks:
- name: get info about the virtual machine
^ here