When I try to invoke CURL i get the following message

error

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Invalid relationship: Exec[install app] { require => Package[curl] }, because Package[curl] doesn't seem to be in the catalog
Warning: Not using cache on failed catalog
Could not retrieve catalog; skipping run


My Manifest

class pwc_testmobility {
$ensure = present exec{'install app': command=> "curl -X GET -k -sS -u user:pass https://mdm1-stg.com/api/v2/labels/label_summary?adminDeviceSpaceId=1", require => [Package['curl']], path => '/etc/puppetlabs/code/environments/production/modules/mobile/manifests', }  Am using the common phase, new to puppet and coding, so any help would be appreciated . I am trying to deploy a mobile using API which is done via curl edit retag close merge delete 2 Answers Sort by » oldest newest most voted It seems like you have not declare a Package Resource (for curl).You declared a relationship (with require), but you didn't declare the resource you are referring to on that dependency. Add the following to your code and check again (you might also need to share a bit more of that code so that we understand the context). package { 'curl': ensure => present, }  more Comments Thanks Stivesso, I will post the cord here in a while ( 2017-09-19 06:02:33 -0600 )edit TLDR: Append package { 'curl': ensure => installed, } somewhere in the class/module/environment where it can be called by this class. First, let's break this down into a readable format: class pwctestmobility {$ensure = present

exec{'install app':
command=> "curl -X GET -k -sS -u user:pass https://mdm1-ukstg.pwcinternal.com/ap...summary?adminDeviceSpaceId=1",
require => [Package['curl']],
path => '/etc/puppetlabs/code/environments/production/modules/mobile/manifests',
}
}


The error indicated that require line. Do you have a package resource declaration for curl? Should look something like:

package { 'curl':
ensure => installed,
}


Also, while unrelated to the error given, the exec resource "path =>" declaration is the search path used for command execution, (similar to the \$PATH environment variable) on the node. So unless the curl executable exists at '/etc/puppetlabs/code/environments/production/modules/mobile/manifests' on each node you plan to push this to it's probably not going to work.

Generally, you need to either declare the absolute path of the executable (ie /usr/bin/curl or similar) or declare the path(s) that it may exist such as:

 path => '/usr/bin'


OR

path => ['/usr/bin', '/usr/sbin'],


You might want to do some more research on those resources:

more

thanks a lot, I will test this and update back, a basic question, I understand CURL will be installed by default in PE or should we do that

( 2017-09-19 06:05:29 -0600 )edit