Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

RSS

libartifact (9) Versions 1.2.1

Library cookbook for managing release artifacts.

Berkshelf/Librarian
Policyfile
Knife
cookbook 'libartifact', '= 1.2.1'
cookbook 'libartifact', '= 1.2.1', :supermarket
knife cookbook site install libartifact
knife cookbook site download libartifact
README
Dependencies
Quality

libartifact-cookbook

Library cookbook which provides a resource for managing release artifacts.

This cookbook takes an opinionated approach to managing release artifacts on the system. It utilizes the libarchive cookbook to extract remote files to a release directory. After this is done it creates (or updates) a current symlink so that scripts can always reference the most recent version of the packaged software.

An example of the layout on the file system would go as follows: sh /srv/twbs % ll total 12K 4.0K drwxr-xr-x. 2 jbellone jbellone 4.0K May 20 14:38 3.3.1/ 4.0K drwxr-xr-x. 2 root root 4.0K May 20 14:38 3.3.2/ 4.0K drwxr-xr-x. 2 jbellone jbellone 4.0K May 20 14:38 3.3.4/ 0 lrwxrwxrwx. 1 root root 15 May 20 14:38 current -> /srv/twbs/3.3.4/

Requirements

Usage

Here is a simple recipe for installing the Redis database. This will extract the files from the remote location to /srv/redis/3.0.1 and create a symbolic link from /srv/redis/current to /srv/redis/3.0.1.

include_recipe 'build-essential::default'

source_version = '3.0.1'
download_url = "http://download.redis.io/releases/%{name}-%{version}.tar.gz"

group 'redis' do
  system true
end

user 'redis' do
  system true
  gid 'redis'
end

libartifact_file 'redis-3.0.1' do
  artifact_name 'redis'
  artifact_version '3.0.1'
  owner 'redis'
  group 'redis'
  remote_url download_url
  notifies :restart, 'service[redis-server]', :delayed
end

service 'redis-server' do
  supports :restart, :reload
  action [:create, :start]
end

It is important to note that the both the user and group must exist. The resource does not make an attempt to create these. If you want to restart a service you can do so using Chef notifications.

libartifact_file Resource/Provider

Actions

Name Description
create Downloads and extracts a released artifact.
delete Deletes a release artifact and unlinks the current symlink.

Parameters

Key Type Description
artifact_name String Name of the release artifact.
artifact_version String Version of the release artifact.
install_path String Absolute path to the base location for extracting release artifact.
binary_url String, Array Location(s) to download the release artifact.
binary_checksum String SHA256 checksum of the release artifact.
owner String Owner of the release artifact.
group String Group of the release artifact.
extract_options Hash Extraction options to pass into the libarchive cookbook.

Foodcritic Metric
            

1.2.1 failed this metric

FC031: Cookbook without metadata file: /tmp/cook/1d6e90a0680ae2e3455c3283/libartifact/metadata.rb:1
FC045: Consider setting cookbook name in metadata: /tmp/cook/1d6e90a0680ae2e3455c3283/libartifact/metadata.rb:1