|
1 Archive Puppet Module |
|
2 ==================== |
|
3 |
|
4 [](https://forge.puppetlabs.com/camptocamp/archive) |
|
5 [](https://forge.puppetlabs.com/camptocamp/archive) |
|
6 [](https://travis-ci.org/camptocamp/puppet-archive) |
|
7 [](https://gemnasium.com/camptocamp/puppet-archive) |
|
8 [](http://www.camptocamp.com) |
|
9 |
|
10 Overview |
|
11 -------- |
|
12 |
|
13 Puppet Module to download and extract tar and zip archives based on [camptocamp/puppet-archive](https://github.com/camptocamp/puppet-archive). |
|
14 |
|
15 Supported archive types are: |
|
16 |
|
17 - `tar.gz`, `tgz` |
|
18 - `tar.bz2`, `tbz2` |
|
19 - `tar.xz`, `txz` |
|
20 - `zip` |
|
21 |
|
22 Features: |
|
23 |
|
24 - Ability to follow redirects |
|
25 - Supports checksum matching |
|
26 |
|
27 Usage |
|
28 ----- |
|
29 |
|
30 Example: |
|
31 |
|
32 archive { 'apache-tomcat-6.0.26': |
|
33 ensure => present, |
|
34 url => 'http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.26/bin/apache-tomcat-6.0.26.tar.gz', |
|
35 target => '/opt', |
|
36 } |
|
37 |
|
38 You can have archive follow redirects by setting: |
|
39 |
|
40 ``` |
|
41 follow_redirects => true |
|
42 ```` |
|
43 |
|
44 The default archive format is ```tar.gz```. To use another supported format you must specify the extenstion: |
|
45 |
|
46 ``` |
|
47 extension => "zip" |
|
48 ``` |
|
49 |
|
50 By default archive will try and find a matching checksum file to verify the download. To disable this behavior set the ```checksum``` option to ```false```: |
|
51 |
|
52 ``` |
|
53 checksum => false |
|
54 ``` |
|
55 |
|
56 You can specify a ```digest_url```, ```digest_string``` and ```digest_type``` to verify archive integrity. |
|
57 |
|
58 For `.tar.gz` and `tar.bz2` archives, the extract step's `--strip-components=n` flag can be accessed. This can be used to [change the name of the extracted directory](http://unix.stackexchange.com/questions/11018/how-to-choose-directory-name-during-untarring). |
|
59 |
|
60 ``` |
|
61 strip_components => 1 |
|
62 ``` |
|
63 |
|
64 ``` |
|
65 purge_target => false |
|
66 ``` |
|
67 |
|
68 By default the target directory is left intact, this option can be used to `rm -rf` the target directory prior to extraction. |
|
69 |
|
70 This full example will download the [packer](packer.io) tool to ```/usr/local/bin```: |
|
71 |
|
72 ``` |
|
73 archive { '0.5.1_linux_amd64': |
|
74 ensure => present, |
|
75 url => 'https://dl.bintray.com/mitchellh/packer/0.5.1_linux_amd64.zip', |
|
76 target => '/usr/local/bin', |
|
77 follow_redirects => true, |
|
78 extension => 'zip', |
|
79 checksum => false, |
|
80 src_target => '/tmp' |
|
81 } |
|
82 ``` |
|
83 |
|
84 You can also specifiy a global user to be used for the whole download and extract operation. Note that the module doesn't handle the right of the specified user on the src_target directory. |
|
85 ``` |
|
86 |
|
87 archive { '0.5.1_linux_amd64': |
|
88 ensure => present, |
|
89 url => 'https://dl.bintray.com/mitchellh/packer/0.5.1_linux_amd64.zip', |
|
90 target => '/usr/local/bin', |
|
91 follow_redirects => true, |
|
92 extension => 'zip', |
|
93 checksum => false, |
|
94 user => 'camptocamp', |
|
95 src_target => '/home/camptocamp' |
|
96 } |
|
97 ``` |
|
98 |
|
99 License |
|
100 ------- |
|
101 |
|
102 Copyright (c) 2012 Camptocamp SA |
|
103 |
|
104 This script is licensed under the Apache License, Version 2.0. |
|
105 |
|
106 See http://www.apache.org/licenses/LICENSE-2.0.html for the full license text. |
|
107 |
|
108 |
|
109 Support |
|
110 ------- |
|
111 |
|
112 Please log tickets and issues at our [project site](https://github.com/camptocamp/puppet-archive/issues). |