This repository has been archived by the owner on Jan 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 102
Adding cookie support to allow for oracle java download #69
Open
girhack
wants to merge
7
commits into
camptocamp:master
Choose a base branch
from
girhack:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3476852
Added cookie support
girhack 4fdad8a
Added cookie support
girhack eff4682
Update init.pp
girhack b06d0ee
Update download.pp
girhack 57c34e6
Bug fix
girhack 4e77a46
Bug fix
girhack 606c434
Added cookie support
girhack File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,9 @@ Usage | |
Example: | ||
|
||
archive { 'apache-tomcat-6.0.26': | ||
"../README.md" 112L, 3378C 1,1 Top | ||
|
||
archive { 'apache-tomcat-6.0.26': | ||
ensure => present, | ||
url => 'http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.26/bin/apache-tomcat-6.0.26.tar.gz', | ||
target => '/opt', | ||
|
@@ -57,6 +60,205 @@ You can specify a ```digest_url```, ```digest_string``` and ```digest_type``` to | |
|
||
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). | ||
|
||
``` | ||
strip_components => 1 | ||
49,0-1 37% | ||
strip_components => 1 | ||
``` | ||
|
||
``` | ||
purge_target => false | ||
``` | ||
|
||
By default the target directory is left intact, this option can be used to `rm -rf` the target directory prior to extraction. | ||
|
||
This full example will download the [packer](packer.io) tool to ```/usr/local/bin```: | ||
|
||
``` | ||
archive { '0.5.1_linux_amd64': | ||
ensure => present, | ||
url => 'https://dl.bintray.com/mitchellh/packer/0.5.1_linux_amd64.zip', | ||
target => '/usr/local/bin', | ||
follow_redirects => true, | ||
extension => 'zip', | ||
checksum => false, | ||
src_target => '/tmp' | ||
} | ||
``` | ||
|
||
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. | ||
``` | ||
|
||
archive { '0.5.1_linux_amd64': | ||
ensure => present, | ||
url => 'https://dl.bintray.com/mitchellh/packer/0.5.1_linux_amd64.zip', | ||
target => '/usr/local/bin', | ||
follow_redirects => true, | ||
search hit BOTTOM, continuing at TOP | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and this? |
||
Overview | ||
-------- | ||
|
||
Puppet Module to download and extract tar and zip archives based on [camptocamp/puppet-archive](https://github.com/camptocamp/puppet-archive). | ||
|
||
Supported archive types are: | ||
|
||
- `tar.gz`, `tgz` | ||
- `tar.bz2`, `tbz2` | ||
- `tar.xz`, `txz` | ||
- `zip` | ||
|
||
Features: | ||
|
||
- Ability to follow redirects | ||
- Supports checksum matching | ||
|
||
Usage | ||
----- | ||
|
||
Example: | ||
|
||
archive { 'apache-tomcat-6.0.26': | ||
ensure => present, | ||
url => 'http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.26/bin/apache-tomcat-6.0.26.tar.gz', | ||
target => '/opt', | ||
} | ||
|
||
You can have archive follow redirects by setting: | ||
|
||
``` | ||
follow_redirects => true | ||
/follow | ||
|
||
``` | ||
purge_target => false | ||
``` | ||
|
||
By default the target directory is left intact, this option can be used to `rm -rf` the target directory prior to extraction. | ||
|
||
This full example will download the [packer](packer.io) tool to ```/usr/local/bin```: | ||
|
||
``` | ||
archive { '0.5.1_linux_amd64': | ||
ensure => present, | ||
url => 'https://dl.bintray.com/mitchellh/packer/0.5.1_linux_amd64.zip', | ||
target => '/usr/local/bin', | ||
follow_redirects => true, | ||
extension => 'zip', | ||
checksum => false, | ||
src_target => '/tmp' | ||
} | ||
``` | ||
|
||
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. | ||
``` | ||
|
||
archive { '0.5.1_linux_amd64': | ||
ensure => present, | ||
url => 'https://dl.bintray.com/mitchellh/packer/0.5.1_linux_amd64.zip', | ||
target => '/usr/local/bin', | ||
follow_redirects => true, | ||
extension => 'zip', | ||
checksum => false, | ||
search hit BOTTOM, continuing at TOP | ||
true => '-k', | ||
default => '', | ||
} | ||
|
||
$redirect_arg = $follow_redirects ? { | ||
true => '-L', | ||
default => '', | ||
} | ||
|
||
$cookie_arg = $allow_cookie ? { | ||
true => "-H \"Cookie: $cookie_value\"", | ||
default => '', | ||
} | ||
|
||
if !defined(Package['curl']) { | ||
package{'curl': | ||
ensure => present, | ||
} | ||
} | ||
|
||
if $proxy_server { | ||
$proxy_option = "--proxy ${proxy_server}" | ||
} else { | ||
$proxy_option = undef | ||
} | ||
|
||
vagrant@vagrantvlc:/etc/puppet/modules/archive/manifests$ ls | ||
download.pp extract.pp init.pp tar_gz.pp zip.pp | ||
vagrant@vagrantvlc:/etc/puppet/modules/archive/manifests$ vi tar_gz.pp | ||
vagrant@vagrantvlc:/etc/puppet/modules/archive/manifests$ less ../README.md | ||
vagrant@vagrantvlc:/etc/puppet/modules/archive/manifests$ vi ../README.md | ||
vagrant@vagrantvlc:/etc/puppet/modules/archive/manifests$ sudo vi ../README.md | ||
vagrant@vagrantvlc:/etc/puppet/modules/archive/manifests$ cat ../README.md | ||
Archive Puppet Module | ||
==================== | ||
|
||
[![Puppet Forge Version](http://img.shields.io/puppetforge/v/camptocamp/archive.svg)](https://forge.puppetlabs.com/camptocamp/archive) | ||
[![Puppet Forge Downloads](http://img.shields.io/puppetforge/dt/camptocamp/archive.svg)](https://forge.puppetlabs.com/camptocamp/archive) | ||
[![Build Status](https://img.shields.io/travis/camptocamp/puppet-archive/master.svg)](https://travis-ci.org/camptocamp/puppet-archive) | ||
[![Gemnasium](https://img.shields.io/gemnasium/camptocamp/puppet-archive.svg)](https://gemnasium.com/camptocamp/puppet-archive) | ||
[![By Camptocamp](https://img.shields.io/badge/by-camptocamp-fb7047.svg)](http://www.camptocamp.com) | ||
|
||
Overview | ||
-------- | ||
|
||
Puppet Module to download and extract tar and zip archives based on [camptocamp/puppet-archive](https://github.com/camptocamp/puppet-archive). | ||
|
||
Supported archive types are: | ||
|
||
- `tar.gz`, `tgz` | ||
- `tar.bz2`, `tbz2` | ||
- `tar.xz`, `txz` | ||
- `zip` | ||
|
||
Features: | ||
|
||
- Ability to follow redirects | ||
- Supports checksum matching | ||
|
||
Usage | ||
----- | ||
|
||
Example: | ||
|
||
archive { 'apache-tomcat-6.0.26': | ||
ensure => present, | ||
url => 'http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.26/bin/apache-tomcat-6.0.26.tar.gz', | ||
target => '/opt', | ||
} | ||
|
||
You can have archive follow redirects by setting: | ||
|
||
``` | ||
follow_redirects => true | ||
```` | ||
|
||
You can set and use prepared cookies using the settings: | ||
|
||
``` | ||
allow_cookie => true | ||
cookie_value => 'some-licence=accept-cookie' | ||
```` | ||
|
||
The default archive format is ```tar.gz```. To use another supported format you must specify the extenstion: | ||
|
||
``` | ||
extension => "zip" | ||
``` | ||
|
||
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```: | ||
|
||
``` | ||
checksum => false | ||
``` | ||
|
||
You can specify a ```digest_url```, ```digest_string``` and ```digest_type``` to verify archive integrity. | ||
|
||
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). | ||
|
||
``` | ||
strip_components => 1 | ||
``` | ||
|
@@ -96,6 +298,21 @@ archive { '0.5.1_linux_amd64': | |
} | ||
``` | ||
|
||
To download oracle java with the approved cookie, you can use the following: | ||
``` | ||
|
||
archive { 'jdk-8u91-linux-x64': | ||
url => 'http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-x64.tar.gz', | ||
target => '/usr/java', | ||
digest_string => '3f3d7d0cd70bfe0feab382ed4b0e45c0', | ||
digest_type => 'md5', | ||
cookie_value=>'oraclelicense=accept-securebackup-cookie', | ||
allow_cookie=>true, | ||
follow_redirects => true, | ||
} | ||
|
||
``` | ||
|
||
License | ||
------- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this?