Ask Your Question

How to solve the dependency of package in 'package section'

asked 2015-03-12 04:05:28 -0500

akshay gravatar image

updated 2015-03-12 08:25:17 -0500

llowder gravatar image
class apache_server {
file {
        ensure => present,
        source => "puppet:///modules/${module_name}/${name}",
#       notify => Package["${name}"],
package {
        ensure => present,
        provider => 'dpkg',
        source => "/home/${name}",
        require => File["/home/${name}"],
        subscribe => Exec["dpkg --install"],
        install_options => ["INSTALLDIR=/usr/bin:/usr/sbin:/sbin"],
exec {
        "dpkg --install":
        command => "/usr/bin/dpkg --install ",
        path => ["/usr/bin","/usr/sbin"],
        refreshonly => true,
apache_server { "apache2_2.4.7-1ubuntu4_amd64(1).deb":, }
apache_server { "apache2-bin_2.4.7-1ubuntu4_amd64.deb":, }
apache_server { "apache2-data_2.4.7-1ubuntu4_all.deb":, }
apache_server { "libapr1_1.5.0-1_amd64.deb":, }
apache_server { "libaprutil1_1.5.3-1_amd64.deb":, }
apache_server { "libaprutil1-dbd-sqlite3_1.5.3-1_amd64.deb", }

When I m running this script on agent side for installing the apache2 package then it gives me error & the error is:

Error: /Stage[main]/Apache_server/File[/home/apache_server]: Could not evaluate: Could not retrieve information from environment production source(s) puppet:///modules/apache_server/apache_server
Notice: /Package[apache_server]: Dependency File[/home/apache_server] has failures: true
Warning: /Package[apache_server]: Skipping because of failed dependencies

So what is the mistake in my code? Please help me.

edit retag flag offensive close merge delete


Looks to me like it's just not finding "puppet:///modules/${module_name}/${name}". Are you sure that the file it's looking for is in the data directory there?

cjeffries gravatar imagecjeffries ( 2015-03-13 15:54:41 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2015-03-16 01:25:44 -0500

Kitty Yeung gravatar image

Are the package files uploaded to

(Puppet Modules Folder)/(Module Name)/files/(package files)


(Puppet Modules Folder)/apacheserver/files/apache2-bin2.4.7-1ubuntu4_amd64.deb

where "files" is a must for the package files location, and it does not need to specify in the "source" command, as the Puppet can recognize this default path.

in addition, it would be good if you can use the parameters to pass the package files name to the class, to make sure the parameters passed and used are correct.

edit flag offensive delete link more


Heyy kitty, I m complete this task. Now i want to install the package on red hat machine. And i m writing the code for that but it cannot working properly. I m asked the question on this forum. Question is How to install the package in rpm Please give me a demo code which works properly.

akshay gravatar imageakshay ( 2015-03-16 04:03:48 -0500 )edit

Your Answer

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

Add Answer

Question Tools



Asked: 2015-03-12 04:05:28 -0500

Seen: 266 times

Last updated: Mar 16 '15