Ask Your Question
0

ArgumentError: Invalid resource type tarball

asked 2013-09-05 09:21:39 -0500

mandm_zoom gravatar image

updated 2013-09-05 09:43:29 -0500

GregLarkin gravatar image

i am trying to untar a deployment file into my agent machine using puppet and getting the following error

puppet-agent[19378]: Could not retrieve catalog from remote server: Error 400 on SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid resource type tarball at /etc/puppet/modules/deploycode/manifests/init.pp:10 on node dev2-db

on my master i created a module called deploycode with 2 files in manifest folder deploycode.pp and init.pp

root@puppet:/etc/puppet# more modules/deploycode/manifests/init.pp 
class deploycode {

    $www = "/var/www/deploy/"
    $pkg_name = "deploycode.tgz"

    tarball { "$pkg_name":
        module_name => "deploycode",
        install_dir ...
(more)
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2013-09-05 15:31:27 -0500

GregLarkin gravatar image

Please try changing your original code from:

tarball { "$pkg_name":
    module_name => "deploycode",
    install_dir => "$www",
    pkg_tgz     => "$pkg_name",
}

to:

deploycode::tarball { "$pkg_name":
    module_name => "deploycode",
    install_dir => "$www",
    pkg_tgz     => "$pkg_name",
}
edit flag offensive delete link more

Comments

You would also need to move the define into a file called tarball.pp

lavaman gravatar imagelavaman ( 2013-09-06 11:57:55 -0500 )edit
0

answered 2013-09-05 14:48:11 -0500

mandm_zoom gravatar image

updated 2013-09-05 15:30:41 -0500

GregLarkin gravatar image

well i got it to work by merging the deploy.pp and init.pp together

class deploycode {
    $www = "/var/www/"
    $pkg_tgz = "deploycode.tgz"

 # create the install directory
    file { "$www":
        ensure  => directory,
    }
 # download the tgz file
    file { "$pkg_tgz":
        path    => "/tmp/$pkg_tgz",
        source  => "puppet:///modules/deploycode/$pkg_tgz",
        notify  => Exec["untar $pkg_tgz"],
    }

 # untar the tarball at the desired location
    exec { "untar $pkg_tgz":
        command => "/bin/rm -rf /tmp/var; /bin/tar xzvf /tmp/$pkg_tgz -C /tmp/
        refreshonly => true,
        require => File["/tmp/$pkg_tgz", "$www"],
    }
}
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-09-05 09:21:39 -0500

Seen: 2,327 times

Last updated: Sep 05 '13