# Check status of VMware tools & reboot if VMware tools are not running

**URL:** <https://forum.ansible.com/t/check-status-of-vmware-tools-reboot-if-vmware-tools-are-not-running/32709>\
**Category:** Ansible Project\
**Tags:** vmware\
**Created:** [April 17, 2020, 7:30am UTC](https://forum.ansible.com/t/check-status-of-vmware-tools-reboot-if-vmware-tools-are-not-running/32709 "2020-04-17T07:30:38Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![David\_Foley](https://avatars.discourse-cdn.com/v4/letter/d/9e8a1a/32.png) [@David\_Foley](https://forum.ansible.com/u/David_Foley)\
**Post date:** [April 19, 2020, 8:54pm UTC](https://forum.ansible.com/t/check-status-of-vmware-tools-reboot-if-vmware-tools-are-not-running/32709/21 "2020-04-19T20:54:38Z")

</div>

Can you Install Ansible 2.9 on a Test Machine and Retest on this version ?

---

<div class="post-metadata">

**Author:** ![Tony\_Wong](https://avatars.discourse-cdn.com/v4/letter/t/3ab097/32.png) [@Tony\_Wong](https://forum.ansible.com/u/Tony_Wong)\
**Post date:** [April 19, 2020, 9:06pm UTC](https://forum.ansible.com/t/check-status-of-vmware-tools-reboot-if-vmware-tools-are-not-running/32709/22 "2020-04-19T21:06:33Z")

</div>

doesnt look like i can do it from apt on ubuntu 18

I need ubuntu 19 for ansible 2.9?

---

<div class="post-metadata">

**Author:** ![David\_Foley](https://avatars.discourse-cdn.com/v4/letter/d/9e8a1a/32.png) [@David\_Foley](https://forum.ansible.com/u/David_Foley)\
**Post date:** [April 19, 2020, 9:14pm UTC](https://forum.ansible.com/t/check-status-of-vmware-tools-reboot-if-vmware-tools-are-not-running/32709/23 "2020-04-19T21:14:55Z")

</div>

> > ````auto
> > 
> > ```
> > $ 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](https://docs.ansible.com/ansible/2.3/intro_installation.html)

No you don’t need to have the latest Ubuntu 19

---

<div class="post-metadata">

**Author:** ![Tony\_Wong](https://avatars.discourse-cdn.com/v4/letter/t/3ab097/32.png) [@Tony\_Wong](https://forum.ansible.com/u/Tony_Wong)\
**Post date:** [April 19, 2020, 9:54pm UTC](https://forum.ansible.com/t/check-status-of-vmware-tools-reboot-if-vmware-tools-are-not-running/32709/24 "2020-04-19T21:54:46Z")

</div>

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 approaches plain English, using SSH, with no agents to install on remote systems.

[http://ansible.com/](http://ansible.com/)  
More info: [https://launchpad.net/~ansible/+archive/ubuntu/ansible](https://launchpad.net/~ansible/+archive/ubuntu/ansible)  
Press [ENTER] to continue or Ctrl-c to cancel adding it.

Hit:1 [https://download.docker.com/linux/ubuntu](https://download.docker.com/linux/ubuntu) bionic InRelease  
Hit:2 [http://ppa.launchpad.net/ansible/ansible/ubuntu](http://ppa.launchpad.net/ansible/ansible/ubuntu) cosmic InRelease  
Ign:3 [http://archive.ubuntu.com/ubuntu](http://archive.ubuntu.com/ubuntu) cosmic InRelease  
Ign:4 [http://archive.ubuntu.com/ubuntu](http://archive.ubuntu.com/ubuntu) cosmic-updates InRelease  
Ign:5 [http://archive.ubuntu.com/ubuntu](http://archive.ubuntu.com/ubuntu) cosmic-backports InRelease  
Ign:6 [http://archive.ubuntu.com/ubuntu](http://archive.ubuntu.com/ubuntu) cosmic-security InRelease  
Err:7 [http://archive.ubuntu.com/ubuntu](http://archive.ubuntu.com/ubuntu) cosmic Release  
404 Not Found [IP: 91.189.88.152 80]  
Err:8 [http://archive.ubuntu.com/ubuntu](http://archive.ubuntu.com/ubuntu) cosmic-updates Release  
404 Not Found [IP: 91.189.88.152 80]  
Err:9 [http://archive.ubuntu.com/ubuntu](http://archive.ubuntu.com/ubuntu) cosmic-backports Release  
404 Not Found [IP: 91.189.88.152 80]  
Err:10 [http://archive.ubuntu.com/ubuntu](http://archive.ubuntu.com/ubuntu) cosmic-security Release  
404 Not Found [IP: 91.189.88.152 80]  
Reading package lists… Done  
E: The repository ‘[http://archive.ubuntu.com/ubuntu](http://archive.ubuntu.com/ubuntu) cosmic Release’ no longer has a Release file.  
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.  
N: See apt-secure(8) manpage for repository creation and user configuration details.  
E: The repository ‘[http://archive.ubuntu.com/ubuntu](http://archive.ubuntu.com/ubuntu) cosmic-updates Release’ no longer has a Release file.  
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.  
N: See apt-secure(8) manpage for repository creation and user configuration details.  
E: The repository ‘[http://archive.ubuntu.com/ubuntu](http://archive.ubuntu.com/ubuntu) cosmic-backports Release’ no longer has a Release file.  
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.  
N: See apt-secure(8) manpage for repository creation and user configuration details.  
E: The repository ‘[http://archive.ubuntu.com/ubuntu](http://archive.ubuntu.com/ubuntu) cosmic-security Release’ no longer has a Release file.  
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.  
N: See apt-secure(8) manpage for repository creation and user configuration details.  
tony@ubuntu:~/ansiblework$ sudo apt-get update  
Hit:1 [https://download.docker.com/linux/ubuntu](https://download.docker.com/linux/ubuntu) bionic InRelease  
Ign:2 [http://archive.ubuntu.com/ubuntu](http://archive.ubuntu.com/ubuntu) cosmic InRelease  
Hit:3 [http://ppa.launchpad.net/ansible/ansible/ubuntu](http://ppa.launchpad.net/ansible/ansible/ubuntu) cosmic InRelease  
Ign:4 [http://archive.ubuntu.com/ubuntu](http://archive.ubuntu.com/ubuntu) cosmic-updates InRelease  
Ign:5 [http://archive.ubuntu.com/ubuntu](http://archive.ubuntu.com/ubuntu) cosmic-backports InRelease  
Ign:6 [http://archive.ubuntu.com/ubuntu](http://archive.ubuntu.com/ubuntu) cosmic-security InRelease  
Err:7 [http://archive.ubuntu.com/ubuntu](http://archive.ubuntu.com/ubuntu) cosmic Release  
404 Not Found [IP: 91.189.88.142 80]  
Err:8 [http://archive.ubuntu.com/ubuntu](http://archive.ubuntu.com/ubuntu) cosmic-updates Release  
404 Not Found [IP: 91.189.88.142 80]  
Err:9 [http://archive.ubuntu.com/ubuntu](http://archive.ubuntu.com/ubuntu) cosmic-backports Release  
404 Not Found [IP: 91.189.88.142 80]  
Err:10 [http://archive.ubuntu.com/ubuntu](http://archive.ubuntu.com/ubuntu) cosmic-security Release  
404 Not Found [IP: 91.189.88.142 80]  
Reading package lists… Done  
E: The repository ‘[http://archive.ubuntu.com/ubuntu](http://archive.ubuntu.com/ubuntu) cosmic Release’ no longer has a Release file.  
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.  
N: See apt-secure(8) manpage for repository creation and user configuration details.  
E: The repository ‘[http://archive.ubuntu.com/ubuntu](http://archive.ubuntu.com/ubuntu) cosmic-updates Release’ no longer has a Release file.  
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.  
N: See apt-secure(8) manpage for repository creation and user configuration details.  
E: The repository ‘[http://archive.ubuntu.com/ubuntu](http://archive.ubuntu.com/ubuntu) cosmic-backports Release’ no longer has a Release file.  
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.  
N: See apt-secure(8) manpage for repository creation and user configuration details.  
E: The repository ‘[http://archive.ubuntu.com/ubuntu](http://archive.ubuntu.com/ubuntu) cosmic-security Release’ no longer has a Release file.  
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.  
N: See apt-secure(8) manpage for repository creation and user configuration details.

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [April 20, 2020, 8:29am UTC](https://forum.ansible.com/t/check-status-of-vmware-tools-reboot-if-vmware-tools-are-not-running/32709/25 "2020-04-20T08:29:37Z")

</div>

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](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 to use the old module name?

---

<div class="post-metadata">

**Author:** ![Tony\_Wong](https://avatars.discourse-cdn.com/v4/letter/t/3ab097/32.png) [@Tony\_Wong](https://forum.ansible.com/u/Tony_Wong)\
**Post date:** [April 22, 2020, 2:41pm UTC](https://forum.ansible.com/t/check-status-of-vmware-tools-reboot-if-vmware-tools-are-not-running/32709/26 "2020-04-22T14:41:32Z")

</div>

I just upgraded ansible to 2.9

but still getting this error

> **(attachments)**
>
> ![Screen Shot 2020-04-22 at 7.41.18 AM.png](https://us1.discourse-cdn.com/ansible/original/2X/3/31d4da20f488a3e38d1ab1575e8c84c6cb387259.png)

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [April 22, 2020, 2:48pm UTC](https://forum.ansible.com/t/check-status-of-vmware-tools-reboot-if-vmware-tools-are-not-running/32709/27 "2020-04-22T14:48:54Z")

</div>

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](https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html)

---

<div class="post-metadata">

**Author:** ![Tony\_Wong](https://avatars.discourse-cdn.com/v4/letter/t/3ab097/32.png) [@Tony\_Wong](https://forum.ansible.com/u/Tony_Wong)\
**Post date:** [April 22, 2020, 3:24pm UTC](https://forum.ansible.com/t/check-status-of-vmware-tools-reboot-if-vmware-tools-are-not-running/32709/28 "2020-04-22T15:24:58Z")

</div>

I dont understand where am I getting the ident issue?

> **(attachments)**
>
> ![Screen Shot 2020-04-22 at 8.24.26 AM.png](https://us1.discourse-cdn.com/ansible/original/2X/8/87db4e42540b8d495b0266a1b535591abbff4d71.png)

---

<div class="post-metadata">

**Author:** ![Akasurde](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/akasurde/32/230_2.png) [@Akasurde](https://forum.ansible.com/u/Akasurde)\
**Post date:** [April 22, 2020, 3:43pm UTC](https://forum.ansible.com/t/check-status-of-vmware-tools-reboot-if-vmware-tools-are-not-running/32709/29 "2020-04-22T15:43:26Z")

</div>

I attached a correct playbook.

> **(attachments)**
>
> ![Screenshot 2020-04-22 at 9.12.52 PM.png](https://us1.discourse-cdn.com/ansible/original/2X/1/12c83779b2bd4678670c87f240140463b6ef4d54.png)

---

<div class="post-metadata">

**Author:** ![Tony\_Wong](https://avatars.discourse-cdn.com/v4/letter/t/3ab097/32.png) [@Tony\_Wong](https://forum.ansible.com/u/Tony_Wong)\
**Post date:** [April 22, 2020, 3:54pm UTC](https://forum.ansible.com/t/check-status-of-vmware-tools-reboot-if-vmware-tools-are-not-running/32709/30 "2020-04-22T15:54:38Z")

</div>

Hi I am still getting error

> **(attachments)**
>
> ![Screen Shot 2020-04-22 at 8.54.15 AM.png](https://us1.discourse-cdn.com/ansible/original/2X/5/5129670967ffdc98797960c926f427d932145c46.png)

---

<div class="post-metadata">

**Author:** ![David\_Foley](https://avatars.discourse-cdn.com/v4/letter/d/9e8a1a/32.png) [@David\_Foley](https://forum.ansible.com/u/David_Foley)\
**Post date:** [April 22, 2020, 4:00pm UTC](https://forum.ansible.com/t/check-status-of-vmware-tools-reboot-if-vmware-tools-are-not-running/32709/31 "2020-04-22T16:00:26Z")

</div>

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 Environment

---

<div class="post-metadata">

**Author:** ![Tony\_Wong](https://avatars.discourse-cdn.com/v4/letter/t/3ab097/32.png) [@Tony\_Wong](https://forum.ansible.com/u/Tony_Wong)\
**Post date:** [April 22, 2020, 4:01pm UTC](https://forum.ansible.com/t/check-status-of-vmware-tools-reboot-if-vmware-tools-are-not-running/32709/32 "2020-04-22T16:01:17Z")

</div>

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  
executable location = /usr/bin/ansible  
python version = 2.7.17 (default, Apr 15 2020, 17:20:14) [GCC 7.5.0]

---

<div class="post-metadata">

**Author:** ![Tony\_Wong](https://avatars.discourse-cdn.com/v4/letter/t/3ab097/32.png) [@Tony\_Wong](https://forum.ansible.com/u/Tony_Wong)\
**Post date:** [April 22, 2020, 4:08pm UTC](https://forum.ansible.com/t/check-status-of-vmware-tools-reboot-if-vmware-tools-are-not-running/32709/33 "2020-04-22T16:08:58Z")

</div>

ok I got it now.

thank you

but where is my info for the vm?

> **(attachments)**
>
> ![Screen Shot 2020-04-22 at 9.08.40 AM.png](https://us1.discourse-cdn.com/ansible/original/2X/3/31d7fe2f078ce99ea6d8172425340476b7d5ba80.png)

---

<div class="post-metadata">

**Author:** ![David\_Foley](https://avatars.discourse-cdn.com/v4/letter/d/9e8a1a/32.png) [@David\_Foley](https://forum.ansible.com/u/David_Foley)\
**Post date:** [April 22, 2020, 4:39pm UTC](https://forum.ansible.com/t/check-status-of-vmware-tools-reboot-if-vmware-tools-are-not-running/32709/34 "2020-04-22T16:39:37Z")

</div>

You need to debug out the message

---

<div class="post-metadata">

**Author:** ![Tony\_Wong](https://avatars.discourse-cdn.com/v4/letter/t/3ab097/32.png) [@Tony\_Wong](https://forum.ansible.com/u/Tony_Wong)\
**Post date:** [April 22, 2020, 4:58pm UTC](https://forum.ansible.com/t/check-status-of-vmware-tools-reboot-if-vmware-tools-are-not-running/32709/35 "2020-04-22T16:58:33Z")

</div>

ok got it

---

<div class="post-metadata">

**Author:** ![Tony\_Wong](https://avatars.discourse-cdn.com/v4/letter/t/3ab097/32.png) [@Tony\_Wong](https://forum.ansible.com/u/Tony_Wong)\
**Post date:** [April 22, 2020, 5:08pm UTC](https://forum.ansible.com/t/check-status-of-vmware-tools-reboot-if-vmware-tools-are-not-running/32709/36 "2020-04-22T17:08:27Z")

</div>

hi to run this for multiple machines, do i need to put it in a vars file?

---

<div class="post-metadata">

**Author:** ![Tony\_Wong](https://avatars.discourse-cdn.com/v4/letter/t/3ab097/32.png) [@Tony\_Wong](https://forum.ansible.com/u/Tony_Wong)\
**Post date:** [April 22, 2020, 5:13pm UTC](https://forum.ansible.com/t/check-status-of-vmware-tools-reboot-if-vmware-tools-are-not-running/32709/37 "2020-04-22T17:13:02Z")

</div>

getting and warning

> **(attachments)**
>
> ![Screen Shot 2020-04-22 at 10.12.36 AM.png](https://us1.discourse-cdn.com/ansible/original/2X/7/73e42f33bbf4eae4db0f8b3e9ba4551d4c788796.png)

---

<div class="post-metadata">

**Author:** ![David\_Foley](https://avatars.discourse-cdn.com/v4/letter/d/9e8a1a/32.png) [@David\_Foley](https://forum.ansible.com/u/David_Foley)\
**Post date:** [April 22, 2020, 5:16pm UTC](https://forum.ansible.com/t/check-status-of-vmware-tools-reboot-if-vmware-tools-are-not-running/32709/38 "2020-04-22T17:16:33Z")

</div>

You need to do loop on the var

---

<div class="post-metadata">

**Author:** ![Tony\_Wong](https://avatars.discourse-cdn.com/v4/letter/t/3ab097/32.png) [@Tony\_Wong](https://forum.ansible.com/u/Tony_Wong)\
**Post date:** [April 22, 2020, 5:20pm UTC](https://forum.ansible.com/t/check-status-of-vmware-tools-reboot-if-vmware-tools-are-not-running/32709/39 "2020-04-22T17:20:33Z")

</div>

I am finding switching from powercli to ansible for vmware tough. any benefits to using ansible vs powercli?

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [April 22, 2020, 5:33pm UTC](https://forum.ansible.com/t/check-status-of-vmware-tools-reboot-if-vmware-tools-are-not-running/32709/40 "2020-04-22T17:33:37Z")

</div>

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.

[Previous page](https://forum.ansible.com/t/check-status-of-vmware-tools-reboot-if-vmware-tools-are-not-running/32709.md?page=1)
