I'm a beginner with Puppet and I would like to know if I'm on the right way to deploy applications with Puppet.
The applciations are in a tar.gz file which contains a file with the version number. So, I do this to deploy (I go on the server and do a client restart to pick up the new tarball):
nodes.pp
node 'server1.domain.com' inherits basenode {
apps { apps:
version => 56,
apps_name => "apps_tarball.tgz",
}
init.pp (modules)
exec {"apps_wget":
command => "/usr/bin/wget http://web_server/${version}-${apps_name} -O /tmp/${container_zip_name}",
unless => "test -f /tmp/${version}-${apps_name}",
require => [ Package["wget"] ],
}
exec {"apps_unzip":
cwd => "/usr/local/apps/path",
command => "/usr/bin/unzip /tmp/${version}-${apps_name}",
unless => "test -f /usr/local/apps/path/apps-version-${version}",
require => [ Package["unzip"], Exec["container_wget"] ],
}
But, when I want to upgrade, I don't know to say Puppet to delete the old directory? For example, If I want to upgrade version 56 to 57: I must delete the 56's version directory.
I heard about Capristrano and it seems to be better to use Puppet for managinig packages, config files and using Capristrano to deploy apps, isn't it?
Thanks.