Ask Your Question
0

How do you deploy a software from master node to a one specific agent node

asked 2013-08-09 13:48:43 -0500

novicepuppetuser gravatar image

updated 2013-08-09 13:57:06 -0500

GregLarkin gravatar image

I been searching a lot to figure this out, but how do you push a software that is on the master node to 1 agent node.

I have this on my site.pp on my master node

node 'domain3' {
    file {'/home/tmp':
        ensure => directory,
    }

    exec { "untar file":
        require => File['/home/tmp'],
        command => "/bin/tar -zxvf /home/zipfile.tar.gz -C /home/tmp",
    }
}

When I ran it, it gave me an error because it is thinking the zipfile is in my agent node, but that file is located on my master node. Does anyone know how to fix this?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2013-08-10 04:46:25 -0500

updated 2013-08-10 04:49:13 -0500

Hi !!

For such binaries you have to use a file resource for you zipfile :

file{'/home/zipfile.tar.gz':
ensure => present,
source => <a source path for your zip file>,
mode => '0700', # Or whatever mode you want
user => 'youruser', # Or whatever user you want
}

The 'source' parameter as got to be a valid source URI such as shown in the file type desciption.

Then you can add this resource to your exec resource and add this new file to the require parameter (as an array):

exec { "untar file":
    require => [File['/home/tmp'],File['/home/zipfile.tar.gz']],
    command => "/bin/tar -zxvf ...
(more)
edit flag offensive delete link more

Comments

This 'staging' module can help automate portions of the download and extract, leaving you with a cleaner looking manifest in the process. https://github.com/nanliu/puppet-staging

evilensky gravatar imageevilensky ( 2013-08-12 08:35:26 -0500 )edit

Forgot this one, nice addition :)

ThinkBriK gravatar imageThinkBriK ( 2013-08-12 09:43:45 -0500 )edit

Thank you for the answer. That fixed my problem.

novicepuppetuser gravatar imagenovicepuppetuser ( 2013-08-13 12:14:34 -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

1 follower

Stats

Asked: 2013-08-09 13:48:43 -0500

Seen: 155 times

Last updated: Aug 12 '13