managing vmware-tools with puppet

65 views
Skip to first unread message

Alex Samad

unread,
Aug 11, 2016, 3:46:00 AM8/11/16
to Puppet Users
Hi

so I have a repo of vmware-tools.*.tgz files located at a website.  

how do I build a module to check 
1) is vmware tool install - check does vmware-toolbox-cmd  exist
2) is it the right version - check for current version is vmware-toolbox-cmd -v

I want to add version number into my hiera DB.  think i have worked out. but not sure how to do the client test.  

I am guessing (psydo code)

if exist vmware-toolbox-cmd  and if vmware-toolbox-cmd -v >= <version wanted>
then 
  do nothing
else
  wget file
  run vmware-install 
fi



Nick Cammorato

unread,
Aug 11, 2016, 4:12:23 AM8/11/16
to puppet...@googlegroups.com
So setting aside if this is a good idea or not, you can do this in a
single exec resource. Look at
https://docs.puppet.com/puppet/latest/reference/types/exec.html

Pay particular attention to onlyif, refreshonly, unless, and creates.
Used either alone or in concert with the file resource type
(https://docs.puppet.com/puppet/4.6/reference/types/file.html#file-attribute-source),
you can set up something roughly like:
file { 'somepath/vmtools.tar.gz': source =>
'http://somesite/vmtools.tar.gz', notify => exec['vmtoolsinst'] } ->
exec { 'vmtoolsinst': command => 'stuffs', refreshonly => true }

which will download the file then run a command on it if it had to
download the file. You could also chain execs ala:
exec { 'curl -o somepath http://somesite/vmtoolsd': onlyif =>
'shell eval of vmware-toolbox-cmd -v output', notify => vmtoolsinst }
exec { 'vmtoolsinst': command => 'stuffs', refreshonly => true }

Now going beyond that, you could add in a custom fact to capture the
value of vmware-toolbox-cmd. This would look something like:
Facter.add('vmtools-toolbox-cmd') do
setcode do
Facter::Core::Execution.exec(' vmware-toolbox-cmd -v')
end
end

You would then be able to do logic based off this fact.

Really though, you should just use the forge - there's a puppet
approved module for vmtools:
https://forge.puppet.com/razorsedge/vmwaretools

HTH,
--Nick
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/7e990f42-22b6-4aff-8887-83768e086cb8%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Alex Samad

unread,
Aug 11, 2016, 5:21:26 AM8/11/16
to puppet...@googlegroups.com
HI

Yes went to puppet forge first, but .. the vmtools module use the
opensource vmtools package, which I could use, but we have decided to
stick with the office install from vmware. and I don't see one of
those anywhere.

Thanks

Alex
> You received this message because you are subscribed to a topic in the Google Groups "Puppet Users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/puppet-users/zjoK2eEPhDg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to puppet-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAKJ8awfg4Z1ZoWXsvtykZjFOJ7%3DwqKSYoFi5q%3DJkZwq90o1ugw%40mail.gmail.com.

Dan White

unread,
Aug 11, 2016, 11:01:19 AM8/11/16
to puppet...@googlegroups.com
Did you know that VMWare encourages the use of the open-vm-tools ?
You might want to reconsider.
Dan White | d_e_...@icloud.com
------------------------------------------------
“Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.”  (Bill Waterson: Calvin & Hobbes)

Rob Nelson

unread,
Aug 11, 2016, 12:03:28 PM8/11/16
to puppet...@googlegroups.com
This. open-vm-tools upgrades seamlessly if you upgrade your kernel, the official tools do not. They are only recommended when open-vm-tools is not available.https://kb.vmware.com/kb/2073803 under VMware Support Policy. I mention this because the official tools will be present, but not synced with the new kernel version, so won't be considered Running by vSphere, even though the processes themselves are running in the Guest OS, which is impossible to ascertain from inside the Guest OS. That's best discovered through any one of the vSphere APIs (like PowerCLI) and then use other tools/actions to remediate your findings, like VUM.
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/7e990f42-22b6-4aff-8887-83768e086cb8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Puppet Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/puppet-users/zjoK2eEPhDg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to puppet-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAKJ8awfg4Z1ZoWXsvtykZjFOJ7%3DwqKSYoFi5q%3DJkZwq90o1ugw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/ca9d3bfe-4f8b-407f-941a-232ba52b1d77%40me.com.

Dan White

unread,
Aug 11, 2016, 12:43:58 PM8/11/16
to puppet...@googlegroups.com
Your response is confusing, Rob.

The process I have been using lately is to uninstall the VMWare-provided tools completely, then install OVT.
It shows up in vSphere
Dan White | d_e_...@icloud.com
------------------------------------------------
“Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.”  (Bill Waterson: Calvin & Hobbes)
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAC76iT_6OCHHo7qQcESVBKouUo7wDdHMbWt9CF6sRv-ZZMekiw%40mail.gmail.com.

Rob Nelson

unread,
Aug 11, 2016, 2:40:09 PM8/11/16
to puppet...@googlegroups.com
Sorry for the confusion. Take 2 :)

Open VM tools: just work
Official VM tools: work after install, but sometimes not after an upgraded kernel, and are difficult to identify and remediate.

Use the Open version, every time!
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--

Alex Samad

unread,
Aug 12, 2016, 1:02:50 AM8/12/16
to puppet...@googlegroups.com
Hi

Thanks, very interesting, I had recently been testing with them. But
they show up in VC as 3rd party... I will check out the KB.


Thanks
Alex
>> email to puppet-users...@googlegroups.com.
>>
>> To view this discussion on the web visit
>>
>>
>> https://groups.google.com/d/msgid/puppet-users/7e990f42-22b6-4aff-8887-83768e086cb8%40googlegroups.com.
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> --
>>
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Puppet Users" group.
>>
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/puppet-users/zjoK2eEPhDg/unsubscribe.
>>
>> To unsubscribe from this group and all its topics, send an email to
>> puppet-users...@googlegroups.com.
>>
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/puppet-users/CAKJ8awfg4Z1ZoWXsvtykZjFOJ7%3DwqKSYoFi5q%3DJkZwq90o1ugw%40mail.gmail.com.
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Puppet Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to puppet-users...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/puppet-users/CAJ%2BQ1PUCVcvxWdP%2BxR5kHVjVHcMmbaPx%3DNfOK_nvrkE3udq0bw%40mail.gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Puppet Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to puppet-users...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/puppet-users/ca9d3bfe-4f8b-407f-941a-232ba52b1d77%40me.com.
>>
>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Puppet Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/puppet-users/zjoK2eEPhDg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> puppet-users...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/CAC76iT_6OCHHo7qQcESVBKouUo7wDdHMbWt9CF6sRv-ZZMekiw%40mail.gmail.com.

Rob Nelson

unread,
Aug 12, 2016, 1:28:12 AM8/12/16
to puppet...@googlegroups.com
There's nothing wrong with them being 3rd party, it's just cannot tell if those are the latest version available for the guest OS.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAJ%2BQ1PVqxgkV%3DQxH0rVvjxa%2BcUcuiL73BxKKu3ZqFQuq_Sw0JA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.


--

Alex Samad

unread,
Aug 12, 2016, 1:45:20 AM8/12/16
to puppet...@googlegroups.com
Hi

from the KB

OVT is available with these operating systems:

Red Hat Enterprise Linux 7.0 and later releases
CentOS 7.0 and later releases


I'm C6. but it looks like its in the EPEL repo.

A
> https://groups.google.com/d/msgid/puppet-users/CAC76iT-C6NzXyWROtepsxRc816mfuDM0%2BA7Yz8PF-Sz7VR_TvA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages