Skip to content

Commit

Permalink
Adds support for installing Riak through a custom package repository.
Browse files Browse the repository at this point in the history
  • Loading branch information
hectcastro committed Sep 13, 2013
1 parent 2bf9729 commit ef9429c
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 7 deletions.
7 changes: 7 additions & 0 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ suites:
minor: 2
incremental: 1
enterprise_key: <%= (ENV["RIAK_ENTERPRISE_KEY"].nil? ? "" : ENV["RIAK_ENTERPRISE_KEY"]) %>
- name: custom_repository
run_list:
- recipe[minitest-handler]
- recipe[riak]
attributes:
riak:
install_method: "custom_repository"
- name: source
run_list:
- recipe[minitest-handler]
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## v2.3.4:
## v2.4.0:

* Added a recipe for installing Riak through a custom package repository.
* Made Test Kitchen run faster by enabling the `vagrant-cachier` plugin
through the `kitchen-vagrant` driver.
* Make default for `cs_version` be `1.4.1`
Expand Down
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,24 @@ The Riak cookbook can be used just by adding "riak" to the runlist for a node.
Package Installation
--------------------

There are two options for package installation: binary and source. If you are using a Red Hat, CentOS, Fedora, Debian or Ubuntu distributions, binary installation is recommended and is the default. If you choose to do a source installation, be sure you are using Erlang/OTP R15B01 or later.
There are two options for package installation: `package` and `custom_repository`. If you are using a Red Hat, CentOS, Fedora, Debian or Ubuntu distributions, `package` installation is recommended and is the default.

The package parameters available are version, type and, optionally for source installation, an install prefix:

node['riak']['package']['version']['major'] = "1"
node['riak']['package']['version']['minor'] = "4"
node['riak']['package']['version']['incremental'] = "2"
```ruby
# default.rb
node['riak']['install_method'] = "package"

# package.rb
node['riak']['package']['version']['major'] = "1"
node['riak']['package']['version']['minor'] = "4"
node['riak']['package']['version']['incremental'] = "2"
```

Source Installation
------------------

The riak::source recipe can be used to install Riak from source. The source installation requires the build-essential and erlang cookbooks.
The `riak::source` recipe can be used to install Riak from source. The source installation requires Erlang/OTP R15B01 or later and the `build-essential` and `erlang` cookbooks.

Enterprise Installation
-------------------
Expand Down
4 changes: 4 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
#
include_attribute "riak::package"

# install method
default['riak']['install_method'] = "package"

# directories
default['riak']['bin_dir'] = "/usr/sbin"
default['riak']['data_dir'] = "/var/lib/riak"
default['riak']['etc_dir'] = "/etc/riak"
Expand Down
7 changes: 7 additions & 0 deletions recipes/custom_repository.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version_str = "#{node['riak']['package']['version']['major']}.#{node['riak']['package']['version']['minor']}"
package_version = "#{version_str}.#{node['riak']['package']['version']['incremental']}-#{node['riak']['package']['version']['build']}"

package "riak" do
action :install
version package_version
end
2 changes: 1 addition & 1 deletion recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
include_recipe "ulimit" unless node['platform_family'] == "debian"

if node['riak']['package']['enterprise_key'].empty?
include_recipe "riak::package"
include_recipe "riak::#{node['riak']['install_method']}"
else
include_recipe "riak::enterprise_package"
end
Expand Down

0 comments on commit ef9429c

Please sign in to comment.