Installing multiple versions of a ZIP archive

13 views
Skip to first unread message

Dirk Heinrichs

unread,
Jan 2, 2015, 3:26:27 AM1/2/15
to puppet...@googlegroups.com
Hi,

lets say I have a small class that simply extracts a given ZIP archive into a destination directory, using a version string passed in as class parameter to identify both the archive and the destination:

class foo ($version = undef) {
    ...
}

If the archive is extracted manually, I can easily extract multiple different versions next to each other, so that I get (for example):

/opt/foo/1/
/opt/foo/2/
...
/opt/foo/n/

However, in Puppet, I can't do this for the same node:

class {'foo': version => '1'}
class {'foo': version => '2'}
class {'foo': version => '3'}

to get multple versions extracted.

I currently achieve this by doing multiple sequential Puppet runs with different values for $version.

There must be a better way to do this. I thought about passing in the versions as an array, but Puppet has no loops. Do I really need to write a custom type and provider for this?

Thanks...

    Dirk
--

Dirk Heinrichs, Senior Systems Engineer, Engineering Solutions
Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach
Tel: +49 2226 1596666 (Ansage) 1149
Email: d...@recommind.com
Skype: dirk.heinrichs.recommind
www.recommind.com

Dirk Heinrichs

unread,
Jan 2, 2015, 5:04:06 AM1/2/15
to puppet...@googlegroups.com
Am 02.01.2015 um 09:26 schrieb Dirk Heinrichs:

There must be a better way to do this. I thought about passing in the versions as an array, but Puppet has no loops.

Found it. Defined types is the way to go.

Bye...
Reply all
Reply to author
Forward
0 new messages