exec shell script fails with Unsupported option –install

37 views
Skip to first unread message

jdt

unread,
Mar 10, 2015, 4:28:09 PM3/10/15
to puppet...@googlegroups.com
Hello,

I'm trying to automate the installation of an HPOV agent on systems with HP's oainstall.sh script.
When manually running the script with the options -install -agent all works fine
When I try to do the same with an exec resource in puppet I get the weird behaviour that it returns with
 INFO:    Unsupported option –install
afterwards it the script returns the 'accepted' flags
Usage:   oainstall.sh -i|-install -m|-mgmt [-p|-platform <platform>] [-includeupdates]
Notice: /Stage[main]/Hpom/Exec[install_hpom_agent]/returns:          oainstall.sh -i|-install -m|-mgmt [-p|-platform <platform>] [-baseonly]
Notice: /Stage[main]/Hpom/Exec[install_hpom_agent]/returns:          oainstall.sh -i|-install -m|-mgmt -pn|-patchname <patchname>
Notice: /Stage[main]/Hpom/Exec[install_hpom_agent]/returns:          oainstall.sh -i|-install -m|-mgmt [-spiconfig <configuration file with full path>]
Notice: /Stage[main]/Hpom/Exec[install_hpom_agent]/returns:          oainstall.sh -i|-install -m|-mgmt [-spiconfig <configuration file with full path>] [-baseonly]
Notice: /Stage[main]/Hpom/Exec[install_hpom_agent]/returns:          oainstall.sh -i|-install -a|-agent -precheckonly

I'm running Puppet 3.6.2 on RHEL/CentOS

The exec in the manifest is like this

exec { 'install_hpom_agent':
  path    => ['/bin','/usr/bin','/sbin','/usr/sbin','/media'],
  command => '/media/oainstall.sh –install –agent -verbose',
  cwd     => '/media',
  user    =>  'root',
  creates  => '/opt/OV/bin/opcagt',
  logoutput => true,
}

I've tried the shell provider instead of the default posix provider, but I haven't been able to get it working.
Does anyone have an idea what could be causing the issue?

Thx,
Jo

Matthew Hyclak

unread,
Mar 10, 2015, 4:31:04 PM3/10/15
to puppet...@googlegroups.com
It looks like the option is -install, not --install.

--
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/8a60d0ca-9723-4b66-97c8-638c788a38c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

jdt

unread,
Mar 10, 2015, 4:55:33 PM3/10/15
to puppet...@googlegroups.com
Hello,

I've found the issue by adding a -x to the shebang of the script.
It was related to the LANG settings, when I modified these to be C via the environment settings in the exec resource it worked just fine

Jo

Op dinsdag 10 maart 2015 17:28:09 UTC+1 schreef jdt:
Reply all
Reply to author
Forward
0 new messages