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0
- 0.5.0
- 0.4.2
- 0.4.0
- 0.3.2
- 0.3.0
- 0.2.4
- 0.2.2
- 0.2.0
- 0.1.0
- 0.0.17
- 0.0.16
- 0.0.15
- 0.0.11
- 0.0.10
- 0.0.9
- 0.0.8
- 0.0.1
Provides a custom resource for installing runtime artifacts in a predictable fashion
cookbook 'ark', '= 1.0.0', :supermarket
knife supermarket install ark
knife supermarket download ark
ark cookbook
Overview
This cookbook provides ark
, a resource for managing software archives. It manages the fetch-unpack-configure-build-install process common to installing software from source, or from binary distributions that are not fully fledged OS packages.
This cookbook started its life as a modified version of Infochimp's install_from cookbook. It has since been heavily refactored and extended to meet different use cases.
Given a simple project archive available at a url:
ark 'pig' do url 'http://apache.org/pig/pig-0.8.0.tar.gz' end
The provider will:
- fetch it to to /var/cache/chef/
- unpack it to the default path (/usr/local/pig-0.8.0
)
- create a symlink for :home_dir
(/usr/local/pig
) pointing to path
- add specified binary commands to the environment PATH
variable
By default, the ark will not run again if the :path
is not empty. Ark provides many actions to accommodate different use cases, such as :dump
, :cherry_pick
, :put
, and :install_with_make
.
At this time ark only handles files available from URLs using the remote_file provider. It does handle local files using the file://
protocol.
Requirements
Platforms
- Debian/Ubuntu
- RHEL/CentOS/Scientific/Oracle
- Fedora
- FreeBSD
- SmartOS
- Mac OS X
Should work on common Unix/Linux systems with typical userland utilities like tar, gzip, etc. May require the installation of build tools for compiling from source, but that installation is outside the scope of this cookbook.
Chef
- Chef 11+
Cookbooks
- build-essential
- seven_zip
- windows
Attributes
Customize the attributes to suit site specific conventions and defaults.
- node['ark']['apache_mirror']
- if the URL is an apache mirror, use the attribute as the default.
- node['ark']['prefix_root']
- default base location if the prefix_root
is not passed into the resource.
- node['ark']['prefix_bin']
- default binary location if the prefix_bin
is not passed into the resource.
- node['ark']['prefix_home']
- default home location if the prefix_home
is not passed into the resource.
- node['ark']['win_install_dir']
- directory where the files will be put on windows
- node['ark']['package_dependencies']
- prerequisite system packages that need to be installed to support ark.
Resources
-
ark
- does the extract/build/configure dance
Actions
-
:install
: extracts the file and creates a 'friendly' symbolic link to the extracted directory path -
:configure
: configure ahead of the install action -
:install_with_make
: extracts the archive to a path, runsmake
, andmake install
. It does not run the configure step at this time -
:dump
: strips all directories from the archive and dumps the contained files into a specified path -
:cherry_pick
: extract a specified file from an archive and places in specified path -
:put
: extract the archive to a specified path, does not create any symbolic links -
:remove
: removes the extracted directory and related symlink #TODO -
:setup_py
: runs the command "python setup.py" in the extracted directory -
:setup_py_build
: runs the command "python setup.py build" in the extracted directory -
:setup_py_install
: runs the command "python setup.py install" in the extracted directory
:cherry_pick
Extract a specified file from an archive and places in specified path.
Relevant Attribute Parameters for :cherry_pick
-
path
: directory to place file in. -
creates
: specific file to cherry-pick.
:dump
Strips all directories from the archive and dumps the contained files into a specified path.
NOTE: This currently only works for zip archives
Attribute Parameters for :dump
-
path
: path to dump files to. -
mode
: file mode forapp_home
, as an integer.- Example:
0775
- Example:
creates
: if you are appending files to a given directory, ark needs a condition to test whether the file has already been extracted. You can specify with creates, a file whose existence indicates the ark has previously been extracted and does not need to be extracted again.
:put
Extract the archive to a specified path, does not create any symbolic links.
Attribute Parameters for :put
-
path
: path to extract to.- Default:
/usr/local
- Default:
append_env_path
: boolean, if true, append the./bin
directory of the extracted directory to the globalPATH
variable for all users.
Attribute Parameters
-
name
: name of the package, defaults to the resource name. -
url
: url for tarball,.tar.gz
,.bin
(oracle-specific),.war
, and.zip
currently supported. Also supports special syntax -
:name:version:apache_mirror:
that will auto-magically construct download url from the apache mirrors site. -
version
: software version, defaults to1
. -
mode
: file mode forapp_home
, is an integer. -
prefix_root
: defaultprefix_root
, for use with:install*
actions. -
prefix_home
: default directory prefix for a friendly symlink to the path.- Example:
/usr/local/maven
->/usr/local/maven-2.2.1
- Example:
-
prefix_bin
: default directory to place a symlink to a binary command.- Example:
/opt/bin/mvn
->/opt/maven-2.2.1/bin/mvn
, where theprefix_bin
is/opt/bin
- Example:
-
path
: path to extract the ark to. The:install*
actions overwrite any user-provided values for:path
.- Default:
/usr/local/<name>-<version>
for the:install
,:install_with_make
actions
- Default:
-
home_dir
: symbolic link to the path:prefix_root/:name-:version
, does not apply to:dump
,:put
, or:cherry_pick
actions.- Default:
:prefix_root/:name
- Default:
-
has_binaries
: array of binary commands to symlink into/usr/local/bin/
, you must specify the relative path.- Example:
[ 'bin/java', 'bin/javaws' ]
- Example:
-
append_env_path
: boolean, similar tohas_binaries
but less granular. If true, append the./bin
directory of the extracted directory to. thePATH
environment variable for all users, by placing a file in/etc/profile.d/
. The commands are symbolically linked into/usr/bin/*
. This option provides more granularity than the boolean option.- Example:
mvn
,java
,javac
, etc.
- Example:
environment
: hash of environment variables to pass to invoked shell commands liketar
,unzip
,configure
, andmake
.strip_components
: number of components in path to strip when extracting archive. With default value of1
, ark strips the leading directory from an archive, which is the default for bothunzip
andtar
commands.-
autoconf_opts
: an array of command line options for use with the GNUautoconf
script.- Example:
[ '--include=/opt/local/include', '--force' ]
- Example:
-
make_opts
: an array of command line options for use withmake
.- Example:
[ '--warn-undefined-variables', '--load-average=2' ]
- Example:
-
owner
: owner of extracted directory.- Default:
root
- Default:
Examples
This example copies ivy.tar.gz
to /var/cache/chef/ivy-2.2.0.tar.gz
, unpacks its contents to /usr/local/ivy-2.2.0/
-- stripping the leading directory, and symlinks /usr/local/ivy
to /usr/local/ivy-2.2.0
# install Apache Ivy dependency resolution tool ark "ivy" do url 'http://someurl.example.com/ivy.tar.gz' version '2.2.0' checksum '89ba5fde0c596db388c3bbd265b63007a9cc3df3a8e6d79a46780c1a39408cb5' action :install end
This example copies jdk-7u2-linux-x64.tar.gz
to /var/cache/chef/jdk-7.2.tar.gz
, unpacks its contents to /usr/local/jvm/jdk-7.2/
-- stripping the leading directory, symlinks /usr/local/jvm/default
to /usr/local/jvm/jdk-7.2
, and adds /usr/local/jvm/jdk-7.2/bin/
to the global PATH
for all users. The user 'foobar' is the owner of the /usr/local/jvm/jdk-7.2
directory:
ark 'jdk' do url 'http://download.example.com/jdk-7u2-linux-x64.tar.gz' version '7.2' path "/usr/local/jvm/" home_dir "/usr/local/jvm/default" checksum '89ba5fde0c596db388c3bbd265b63007a9cc3df3a8e6d79a46780c1a39408cb5' append_env_path true owner 'foobar' end
Install Apache Ivy dependency resolution tool in <path>/resource_name in this case /usr/local/ivy
, do not symlink, and strip any leading directory if one exists in the tarball:
ark "ivy" do url 'http://someurl.example.com/ivy.tar.gz' checksum '89ba5fde0c596db388c3bbd265b63007a9cc3df3a8e6d79a46780c1a39408cb5' action :put end
Install Apache Ivy dependency resolution tool in /home/foobar/ivy, strip any leading directory if one exists:
ark "ivy" do path "/home/foobar" url 'http://someurl.example.com/ivy.tar.gz' checksum '89ba5fde0c596db388c3bbd265b63007a9cc3df3a8e6d79a46780c1a39408cb5' action :put end
Strip all directories and dump files into path specified by the path attribute. You must specify the creates
attribute in order to keep the extraction from running every time. The directory path will be created if it doesn't already exist:
ark "my_jars" do url "http://example.com/bunch_of_jars.zip" path "/usr/local/tomcat/lib" creates "mysql.jar" owner "tomcat" action :dump end
Extract specific files from a tarball (currently only handles one named file):
ark 'mysql-connector-java' do url 'http://oracle.com/mysql-connector.zip' creates 'mysql-connector-java-5.0.8-bin.jar' path '/usr/local/tomcat/lib' action :cherry_pick end
Build and install haproxy and use alternative values for prefix_root
, prefix_home
, and prefix_bin
:
ark "haproxy" do url "http://haproxy.1wt.eu/download/1.5/src/snapshot/haproxy-ss-20120403.tar.gz" version "1.5" checksum 'ba0424bf7d23b3a607ee24bbb855bb0ea347d7ffde0bec0cb12a89623cbaf911' make_opts [ 'TARGET=linux26' ] prefix_root '/opt' prefix_home '/opt' prefix_bin '/opt/bin' action :install_with_make end
You can also pass multiple actions to ark and supply the file extension in case the file extension can not be determined by the URL:
ark "test_autogen" do url 'https://github.com/zeromq/libzmq/tarball/master' extension "tar.gz" action [ :configure, :install_with_make ] end
License and Authors
- Author: Philip (flip) Kromer - Infochimps, Inc(coders@infochimps.com)
- Author: Bryan W. Berry (bryan.berry@gmail.com)
- Author: Denis Barishev (denis.barishev@gmail.com)
- Author: Sean OMeara (someara@chef.io)
- Author: John Bellone (jbellone@bloomberg.net)
- Copyright: 2011, Philip (flip) Kromer - Infochimps, Inc
- Copyright: 2012, Bryan W. Berry
- Copyright: 2012, Denis Barishev
- Copyright: 2013, Chef Software, Inc
- Copyright: 2014, Bloomberg L.P.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Dependent cookbooks
build-essential >= 0.0.0 |
windows >= 0.0.0 |
seven_zip >= 0.0.0 |
Contingent cookbooks
ark Cookbook CHANGELOG
This file is used to list changes made in each version of the ark cookbook.
v1.0.0 (2016-02-09)
- Added the pkg-config package to the debian platform family
- Added tar, xz-lzma-compat, and bzip2 packages to the RHEL and fedora platform families
- Updated FreeBSD to install gmake instead of make
- Added OS X, SmartOS, and FreeBSD to the tar path attributes to support those platforms
- Removed the has_binaries attribute from put action documentation in the readme file since this isn't supported there
- Moved the libraries module locations to no longer be under Opscode:: and broke out libraries into more logical units
- Fixed issues with spaces in Windows paths that could cause failures
- Fixed a bad attribute for the 7zip home on windows. Instead of using a node attribute use the value directly to avoid computed attribute overiding issues
- Switched from the 7-zip cookbook to seven_zip since the 7-zip cookbook is now deprecated
- Changed unzip commands to not use -u so that a newer archive can overwrite an existing directory
- Added support for actions py_setup, py_setup_install, py_setup_build
- Fixed setting home_dir attribute
- Added source_url and issues_url to the metadata.rb
- Expanded the supported platforms in metadata.rb
- Removed all references to Opscode
- Improved error logging when an unknown extension is encountered
- Added support for .tar files
- Improved overall testing:
- Removed the kitchen.cloud.yml file and gem dependencies
- Added integration testing in Travis with Kitchen-Docker and Travis tests now run using the nightly build of ChefDK
- Expanded platforms tested in the .kitchen.yml file
- Updated the Gemfile with the latest testing dependencies
- Added full Chefspec coverage
- Greatly expanded the ark_spec test cookbook
- Removed the original minitests
- Added standard Chef .gitignore and chefignore files
- Resolved a large number of rubocop warnings
- Removed old Opscode contributing and testing docs
- Added a cookbook version badge to the readme
- Removed the Toftfile
v0.9.0 (2014-06-06)
- [COOK-3642] Add Windows support
v0.8.2 (2014-04-23)
- [COOK-4514] - Support for SLES with the Ark cookbook
v0.8.0 (2014-04-10)
- [COOK-2771] - Add support for XZ compression
v0.7.2 (2014-03-28)
- [COOK-4477] - Fix failing test suite
- [COOK-4484] - Replace strip_leading_dir attribute with more general strip_components
v0.7.0 (2014-03-18)
- [COOK-4437] - configure and install_with_make should chown after unpack
v0.6.0 (2014-02-27)
[COOK-3786] - Unable to install multiple versions of archive without duplication
v0.5.0 (2014-02-21)
Bug
- COOK-4288 - Cleanup the Kitchen
Improvement
- COOK-4264 - Add node['ark']['package_dependencies'] to allow tuning packages.
v0.4.2
Improvement
- COOK-3854 - Capability with mac_os_x: '/bin/chown' - No such file or directory
- Cleaning up some style for rubucop
- Updating test harness
v0.4.0
Improvement
- COOK-3539 - Allow dumping of bz2 and gzip files
v0.3.2
Bug
- COOK-3191 - Propogate unzip failures
- COOK-3118 - Set cookbook attribute in provider
- COOK-3055 - Use proper scope in helper module
- COOK-3054 - Fix notification resource updating
Improvement
- COOK-3179 - README updates and refactor
v0.3.0
Improvement
- [COOK-3087]: Can't use ark with chef < 11
Bug
- [COOK-3064]:
only_if
statements in ark'sinstall_with_make
and configure actions are not testing for file existence correctly. - [COOK-3067]: ark kitchen test for
cherry_pick
is expecting the binary to be in the same parent folder as in the archive.
v0.2.4
Bug
- [COOK-3048]: Ark provider contains a
ruby_block
resource without a block attribute - [COOK-3063]: Ark cookbook
cherry_pick
action's unzip command does not close if statement - [COOK-3065]: Ark install action does not symlink binaries correctly
v0.2.2
- Update the README to reflect the requirement for Chef 11 to use the ark resource (
use_inline_resources
). - Making this a release so it will also appear on the community site page.
v0.2.0
Bug
- [COOK-2772]: Ark cookbook has foodcritic failures in provides/default.rb
Improvement
- [COOK-2520]: Refactor ark providers to use the '
use_inline_resources
' LWRP DSL feature
v0.1.0
- [COOK-2335] - ark resource broken on Chef 11
v0.0.1
- [COOK-2026] - Allow
cherry_pick
action to be used for directories as well as files
v0.0.1
- [COOK-1593] - README formatting updates for better display on Community Site
v0.0.1
Bug
- dangling "unless"
Improvement
- add
setup_py_*
actions - add vagrantfile
- add foodcritic test
- travis.ci support
v0.0.10 (May 23, 2012
Bug
-
strip_leading_dir
not working for zip files https://github.com/bryanwb/chef-ark/issues/19
Improvement
- use autogen.sh to generate configure script for configure action https://github.com/bryanwb/chef-ark/issues/16
- support more file extensions https://github.com/bryanwb/chef-ark/pull/18
- add extension attribute which allows you to download files which do not have the file extension as part of the URL
Foodcritic Metric
1.0.0 passed this metric
1.0.0 passed this metric