Ask Your Question

Revision history [back]

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:

https://docs.puppet.com/puppet/latest/types/package.html https://docs.puppet.com/puppet/5.2/types/exec.html#exec-attribute-path https://docs.puppet.com/puppet/5.2/metaparameter.html#require