Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-22 Thread Dick Visser
With all due respect, this is a support mailing list, not a chat room. I will suggest to spend some time doing research first, before firing off a ton of questions that could have been answered by Googling for 10 seconds. On Wed, 22 Apr 2020 at 19:20, Tony Wong wrote: > > I am finding

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-22 Thread Tony Wong
I am finding switching from powercli to ansible for vmware tough. any benefits to using ansible vs powercli? On Wed, Apr 22, 2020 at 10:16 AM David Foley wrote: > You need to do loop on the var > > -- > You received this message because you are subscribed to the Google Groups > "Ansible

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-22 Thread David Foley
You need to do loop on the var -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To view this discussion on the

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-22 Thread Tony Wong
hi to run this for multiple machines, do i need to put it in a vars file? On Wed, Apr 22, 2020 at 9:58 AM Tony Wong wrote: > ok got it > > > > > On Wed, Apr 22, 2020 at 9:39 AM David Foley wrote: > >> You need to debug out the message >> >> -- >> You received this message because you are

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-22 Thread Tony Wong
ok got it On Wed, Apr 22, 2020 at 9:39 AM David Foley wrote: > You need to debug out the message > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-22 Thread David Foley
You need to debug out the message -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To view this discussion on

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-22 Thread Tony Wong
my ansible version tony@ubuntu:~/ansiblework$ ansible --version ansible 2.9.0 config file = /home/tony/ansiblework/ansible.cfg configured module search path = [u'/home/tony/ansiblework/library'] ansible python module location = /home/tony/.local/lib/python2.7/site-packages/ansible

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-22 Thread David Foley
Still ident While Fixing The Last Ident Issue you seem to have moved everything to the Left: Abhijeet Kasurde Just attached the Correct Way of Doing It; I would Recommend Reading / Watching Some Ansible Videos before taken on some Projects: you may end-up doing more harm then good within your

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-22 Thread Dick Visser
You continue to get that error because you continue to mess up the indentation. Sort that first. https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html On Wed, 22 Apr 2020 at 16:41, Tony Wong wrote: > > I just upgraded ansible to 2.9 > > but still getting this error > >

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-20 Thread Dick Visser
You are using vmware_guest_info module, which was introduced in ansible 2.9: https://docs.ansible.com/ansible/latest/modules/vmware_guest_info_module.html On that page it also says that the module used to be called vmware_guest_facts prior to 2.9. Given that you have difficulty upgrading, try

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-19 Thread Tony Wong
tony@ubuntu:~/ansiblework$ sudo apt-add-repository ppa:ansible/ansible Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications— automate in a language that

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-19 Thread David Foley
> > $ sudo apt update >> $ sudo apt install software-properties-common >> $ sudo apt-add-repository --yes --update ppa:ansible/ansible >> $ sudo apt install ansible >> >> https://docs.ansible.com/ansible/2.3/intro_installation.html No you don't need to have the latest Ubuntu 19 > >> >> --

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-19 Thread Tony Wong
doesnt look like i can do it from apt on ubuntu 18 I need ubuntu 19 for ansible 2.9? On Sun, Apr 19, 2020 at 1:54 PM David Foley wrote: > Can you Install Ansible 2.9 on a Test Machine and Retest on this version ? > > >>> -- > You received this message because you are subscribed to the Google

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-19 Thread David Foley
Can you Install Ansible 2.9 on a Test Machine and Retest on this version ? >> -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-19 Thread Tony Wong
it is already indented On Sun, Apr 19, 2020 at 12:47 PM Stefan Hornburg (Racke) wrote: > On 4/19/20 9:13 PM, Tony Wong wrote: > > Screen Shot 2020-04-19 at 12.10.46 PM.png > > > > > > > > tony@ubuntu:~/ansiblework$ ansible-playbook vmware_tools.yml > > [WARNING]: provided hosts list is empty,

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-19 Thread Stefan Hornburg (Racke)
On 4/19/20 9:13 PM, Tony Wong wrote: > Screen Shot 2020-04-19 at 12.10.46 PM.png > > > > 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

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-19 Thread Tony Wong
tony@ubuntu:~/ansiblework$ ansible --version ansible 2.8.2 config file = /home/tony/ansiblework/ansible.cfg configured module search path = [u'/home/tony/ansiblework/library'] ansible python module location = /usr/lib/python2.7/dist-packages/ansible executable location = /usr/bin/ansible

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-19 Thread Kiran Kumar
Use https://onlineyamltools.com/validate-yaml This will help you validate the syntax On Saturday, April 18, 2020 at 2:26:10 PM UTC-7, Tony Wong wrote: > > this is what i have. but still not working > > On Sat, Apr 18, 2020 at 1:55 PM David Foley > wrote: > >> Why Aren't you using your Local

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-19 Thread Kiran Kumar
Thanks Abhijeet ! On Friday, April 17, 2020 at 1:26:53 AM UTC-7, Abhijeet Kasurde wrote: > > --- > - hosts: localhost > vars_files: > - vcenter_vars.yml > vars: > vm_list: > - test01 > tasks: > - name: Get information about the virtual machine > vmware_guest_info: > validate_certs: False >

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-18 Thread Dick Visser
What does 'ansible --version' say? On Sat, 18 Apr 2020 at 23:26, Tony Wong wrote: > this is what i have. but still not working > > On Sat, Apr 18, 2020 at 1:55 PM David Foley wrote: > >> Why Aren't you using your Local Machine using Atom or VS Code to build >> your Yaml files then using WinSCP

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-18 Thread Tony Wong
this is what i have. but still not working On Sat, Apr 18, 2020 at 1:55 PM David Foley wrote: > Why Aren't you using your Local Machine using Atom or VS Code to build > your Yaml files then using WinSCP copy the playbooks over ? > > On Saturday, April 18, 2020 at 9:43:00 PM UTC+1, Tony Wong

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-18 Thread David Foley
Why Aren't you using your Local Machine using Atom or VS Code to build your Yaml files then using WinSCP copy the playbooks over ? On Saturday, April 18, 2020 at 9:43:00 PM UTC+1, Tony Wong wrote: > > what editor can i use on my ubuntu box? I cant use anything other than > vim. > > > still

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-18 Thread David Foley
you missing* " - " * On Saturday, April 18, 2020 at 9:46:14 PM UTC+1, Tony Wong wrote: > > > > On Sat, Apr 18, 2020 at 1:42 PM Tony Wong > > wrote: > >> what editor can i use on my ubuntu box? I cant use anything other than >> vim. >> >> >> still getting the error. >> >>

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-18 Thread Tony Wong
On Sat, Apr 18, 2020 at 1:42 PM Tony Wong wrote: > 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

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-18 Thread Tony Wong
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

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-18 Thread David Foley
--- - name: get info vm hosts: localhost connection: local gather_facts: false tasks: - name: get info about the virtual machine vmware_guest_info: hostname: vcnerter username: password: datacenter: DC validate_certs: False name: myvm

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-18 Thread Jean-Yves LENHOF
Please as said by another people here, respect indentations stricly ! vmware_guest_info& name have not the same indentation as written by A. Kasurde Regards, JYL Le 18/04/2020 à 22:14, Tony Wong a écrit : this is the playbook --- - name: get info vm   hosts: localhost   connection: local

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-18 Thread Tony Wong
this is the playbook --- - name: get info vm hosts: localhost connection: local gather_facts: false tasks: - name: get info about the virtual machine vmware_guest_info: hostname: vcnerter username: administrator@vsphere.local password:

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-18 Thread Dick Visser
That module was introduced in ansible 2.5: https://docs.ansible.com/ansible/latest/modules/vmware_guest_powerstate_module.html Do you run an older version? On Sat, 18 Apr 2020 at 20:22, Tony Wong wrote: > Hi > > why is it when i run this playbook I get this error > >

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-18 Thread Jorge Rúa
That error message often indicates an indentation issue or a missing module parameter. On Sat, Apr 18, 2020, 20:22 Tony Wong wrote: > Hi > > 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

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-18 Thread Tony Wong
Hi 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

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-17 Thread Abhijeet Kasurde
--- - hosts: localhost vars_files: - vcenter_vars.yml vars: vm_list: - test01 tasks: - name: Get information about the virtual machine vmware_guest_info: validate_certs: False hostname: '{{ vcenter_hostname }}' username: '{{ vcenter_username }}' password: '{{ vcenter_password }}' folder:

[ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-17 Thread Kiran Kumar
Hi 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