Ask Your Question
2

'sysctl -p' is not qualified and no path was specified. Please qualify the command or specify a path.

asked 2013-07-16 13:57:43 -0500

kenorb gravatar image

I've got the following file:

$ cat manifests/sysctl.pp 
# /etc/puppet/modules/sysctl/manifests/init.pp
class sysctl {
   file { "sysctl_conf":
      name => $operatingsystem ? {
        default => "/etc/sysctl.conf",
      },
   }

   exec { "sysctl -p":
      alias => "sysctl",
      refreshonly => true,
      subscribe => File["sysctl_conf"],
   }
}

# /etc/puppet/modules/sysctl/manifests/conf.pp
define sysctl::conf ( $value ) {

  include sysctl

  # $title contains the title of each instance of this defined type

  # guid of this entry
  $key = $title

  $context = "/files/etc/sysctl.conf"

   augeas { "sysctl_conf/$key":
     context => "$context",
     onlyif  => "get $key != '$value'",
     changes => "set $key '$value'",
     notify  => Exec["sysctl"],
   }

}

as suggested at: projects.puppetlabs.com/projects/1/wiki/puppet_augeas#/etc/sysctl ... (more)

edit retag flag offensive close merge delete

4 answers

Sort by ยป oldest newest most voted
2

answered 2013-07-16 14:07:42 -0500

GregLarkin gravatar image

The example should be updated to change:

   exec { "sysctl -p":
      alias => "sysctl",
      refreshonly => true,
      subscribe => File["sysctl_conf"],
   }

to:

   exec { "sysctl":
      command => "/sbin/sysctl -p",
      refreshonly => true,
      subscribe => File["sysctl_conf"],
   }
edit flag offensive delete link more
4

answered 2013-07-16 14:21:11 -0500

ramindk gravatar image

updated 2013-07-16 15:40:55 -0500

If you go back to the page there is a large red Warning telling you the wiki is outdated and usually just plain wrong. Nearly everything on the wiki will have problems. The docs on http://docs.puppetlabs.com/ are kept up to date and far better written.

The large problem in this example is that import of modules has been deprecated since 2.7 and a bad idea since 0.25. As long as the class live in /etc/puppet/modules/sysctl/ Puppet will find it. Import if used to load classes will cause a number of weird problems ... (more)

edit flag offensive delete link more
0

answered 2015-01-09 08:40:17 -0500

In my case, the only error was I did not have the comma at the end of the line.

To install composer I added to app.pp :

exec { "install composer":
    command => "/usr/bin/sudo /usr/bin/curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin"
}

and I needed the same but with a comma:

exec { "install composer":
    command => "/usr/bin/sudo /usr/bin/curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin",
}
edit flag offensive delete link more
0

answered 2015-04-06 14:05:10 -0500

kenorb gravatar image

You need to use fully qualified path.

For example either:

exec { "sample":
  command => "/usr/bin/test",
}

or:

exec { "sample":
  path    => ['/usr/bin', '/usr/sbin', '/bin'],
  command => "test",
}
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-07-16 13:57:43 -0500

Seen: 11,488 times

Last updated: Apr 06 '15