craigwatson / puppet-vmwaretools

Puppet module for non-OSP VMware Tools Installation
http://forge.puppetlabs.com/CraigWatson1987/vmwaretools
Apache License 2.0
27 stars 40 forks source link

Error: /Stage[main]/Vmwaretools::Install::Exec/Exec[download_vmwaretools]: Failed to call refresh: /opt/vmware/download.sh returned 1 instead of one of [0] #77

Closed chaitu011 closed 8 years ago

chaitu011 commented 8 years ago

Hi Criag

I'm trying to install VMware-tools on a node and getting following error when I run puppet agent on node:

# puppet agent -t
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for xxx.xxx.xxx.xxx
Info: Applying configuration version '1455887193'
Notice: /Stage[main]/Vmwaretools::Install/File[/opt/vmware]/ensure: created
Notice: /Stage[main]/Vmwaretools::Install::Archive/File[/opt/vmware/download.sh]/ensure: defined content as '{md5}8ecf04b3420ddc33af656eab813cbcd1'
Info: /Stage[main]/Vmwaretools::Install::Archive/File[/opt/vmware/download.sh]: Scheduling refresh of Exec[download_vmwaretools]
Notice: /Stage[main]/Vmwaretools::Install::Exec/Exec[download_vmwaretools]/returns: Download failed from url xxx.xxx.xxx.xxx:/etc/puppetlabs/puppet/environments/production/modules/vmwaretools/files/VMwareTools-latest.tar.gz
Error: /Stage[main]/Vmwaretools::Install::Exec/Exec[download_vmwaretools]: Failed to call refresh: /opt/vmware/download.sh returned 1 instead of one of [0]
Error: /Stage[main]/Vmwaretools::Install::Exec/Exec[download_vmwaretools]: /opt/vmware/download.sh returned 1 instead of one of [0]
Error: Could not find command '/usr/bin/vmware-config-tools.pl'
Error: /Stage[main]/Vmwaretools::Config_tools/Exec[vmware_config_tools]/returns: change from notrun to 0 failed: Could not find command '/usr/bin/vmware-config-tools.pl'
Notice: Finished catalog run in 7.54 seconds

I saved the gzip file under following location in puppet master: /etc/puppetlabs/puppet/environments/production/modules/vmwaretools/manifests/init.pp

$archive_url          = 'xxx.xxx.xxx.xxx:/etc/puppetlabs/puppet/environments/production/modules/vmwaretools/files',

I get following error when I run this manually on node:

# /usr/bin/curl -s xxx.xxx.xxx.xxx:/etc/puppetlabs/puppet/environments/production/modules/vmwaretools/files/VMwareTools-latest.tar.gz /opt/vmware/ -v
* getaddrinfo(3) failed for xxx.xxx.xxx.xxx::80
* Couldn't resolve host 'xxx.xxx.xxx.xxx:'
* Closing connection #0
* <url> malformed

But DNS works perfectly fine and can resolve hostname of the puppet server.

# cat /etc/puppetlabs/puppet/hiera.yaml

---
:backends:
  - yaml
:hierarchy:
  - "%{clientcert}"
  - "%{environment}"
  - "%{::dc}"
  - "nodes/%{::trusted.certname}"
#  - "virtual/%{::virtual}"
#  - "osfamily/%{::osfamily}"
  - "%{virtual}"
  - "%{osfamily}"
  - common

:yaml:
# datadir is empty here, so hiera uses its defaults:
# - /var/lib/hiera on *nix
# - %CommonAppData%\PuppetLabs\hiera\var on Windows
# When specifying a datadir, make sure the directory exists.
  :datadir: /var/lib/hiera
  :merge_behavior: deeper
cat /var/lib/hiera/RedHat.yaml

---
vmwaretools::working_dir: /opt/vmware
# cat /var/lib/hiera/common.yaml

---
vmwaretools::version: latest

IPtables are disabled on both master and node and they are on same subnet with same OS version and on same ESXi.

craigwatson commented 8 years ago

Hi,

Does the file /etc/puppetlabs/puppet/environments/production/modules/vmwaretools/files/VMWareTools-latest.tar.gzfile exist?

Thanks, Craig

chaitu011 commented 8 years ago

Yup It does.

# ls -l /etc/puppetlabs/puppet/environments/production/modules/vmwaretools/files/
total 69780
-r--r--r-- 1 root root 71451709 Feb 19 18:17 VMwareTools-10.0.0-3000743.tar.gz
craigwatson commented 8 years ago

Hi,

You need to pass the full version number to the module - it doesn't understand latest like the package resource does.

For example:

class { 'vmwaretools':
  version => 10.0.0-3000743,
}

Or in Hiera:

vmwaretools::version: 10.0.0-3000743

Craig

chaitu011 commented 8 years ago

I realized soon after replying to your post that "VMWareTools-latest.tar.gz" file does not exist in that folder, so I copied existing file and created one more file in master.

# ls -l /etc/puppetlabs/puppet/environments/production/modules/vmwaretools/files/
total 139560
-r--r--r-- 1 root root 71451709 Feb 19 18:17 VMwareTools-10.0.0-3000743.tar.gz
-r--r--r-- 1 root root 71451709 Feb 22 15:29 VMWareTools-latest.tar.gz

Then I updated the Hiera file as you mentioned, just to try with version number this time.

# cat /var/lib/hiera/common.yaml
---
vmwaretools::version: 10.0.0-3000743

Still getting same error on node:

# puppet agent -t
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for xxx.xxx.xxx.xxx
Info: Applying configuration version '1456135702'
Notice: /Stage[main]/Vmwaretools::Install/File[/opt/vmware]/ensure: created
Notice: /Stage[main]/Vmwaretools::Install::Archive/File[/opt/vmware/download.sh]/ensure: defined content as '{md5}5cdab6dca13e1ca6cee3e8a5746bcc62'
Info: /Stage[main]/Vmwaretools::Install::Archive/File[/opt/vmware/download.sh]: Scheduling refresh of Exec[download_vmwaretools]
Notice: /Stage[main]/Vmwaretools::Install::Exec/Exec[download_vmwaretools]/returns: Download failed from url xxx.xxx.xxx.xxx:/etc/puppetlabs/puppet/environments/production/modules/vmwaretools/files/VMwareTools-10.0.0-3000743.tar.gz
Error: /Stage[main]/Vmwaretools::Install::Exec/Exec[download_vmwaretools]: Failed to call refresh: /opt/vmware/download.sh returned 1 instead of one of [0]
Error: /Stage[main]/Vmwaretools::Install::Exec/Exec[download_vmwaretools]: /opt/vmware/download.sh returned 1 instead of one of [0]
Error: Could not find command '/usr/bin/vmware-config-tools.pl'
Error: /Stage[main]/Vmwaretools::Config_tools/Exec[vmware_config_tools]/returns: change from notrun to 0 failed: Could not find command '/usr/bin/vmware-config-tools.pl'
Notice: Finished catalog run in 12.50 seconds

On node I could see /opt/vmware folder is created and download.sh also file created

download.sh..docx

pied under that dir.

craigwatson commented 8 years ago

Hi,

You don't need to provide the server URL, and the Tools gzip should either be available over HTTP or via Puppet.

If you want to distribute the gzip via Puppet, all you need to do is set the version number, the rest is handled automatically.

For example:

class { 'vmwaretools':
  version => '10.0.0-3000743',
}

Craig

chaitu011 commented 8 years ago

Thanks. It worked via puppet. I think for some reason http is not working from puppet server. You can close the thread.

-- Anil Kumar V