Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 0 additions & 92 deletions .kitchen.dokken.yml

This file was deleted.

80 changes: 60 additions & 20 deletions .kitchen.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,75 @@
---
driver:
name: vagrant
name: dokken
chef_version: latest
privileged: true
transport:
name: dokken
provisioner:
name: chef_zero
name: dokken
verifier:
name: inspec
platforms:
- name: ubuntu-16.04
named_run_list: debian
- name: ubuntu-14.04
named_run_list: debian
- name: ubuntu-12.04
named_run_list: debian
- name: centos-7.2
named_run_list: centos
- name: centos-6.8
- name: centos-7
named_run_list: centos
- name: centos-5.11
driver:
image: centos:7
platform: rhel
pid_one_command: /usr/lib/systemd/systemd
intermediate_instructions:
- RUN yum -y install lsof which systemd-sysv initscripts sudo
attributes:
poise-service:
redis:
provider: systemd
- name: centos-6
named_run_list: centos
- name: ubuntu-14.04
driver:
image: centos:6
platform: rhel
pid_one_command: /sbin/init
intermediate_instructions:
- RUN yum -y install which initscripts sudo
- name: ubuntu-16.04
named_run_list: debian
- name: ubuntu-12.04
driver:
image: ubuntu:16.04
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update -y
- RUN /usr/bin/apt-get install sudo -y
attributes:
poise-service:
redis:
provider: systemd
- name: ubuntu-14.04
named_run_list: debian
- name: freebsd-10.3
named_run_list: freebsd
- name: freebsd-9.3
named_run_list: freebsd
- name: debian-8.5
driver:
image: ubuntu:14.04
pid_one_command: /sbin/init
intermediate_instructions:
- RUN /usr/bin/apt-get update -y
- RUN /usr/bin/apt-get install sudo -y
- name: debian-8
named_run_list: debian
- name: debian-7.11
driver:
image: debian:8
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update
- RUN /usr/bin/apt-get install lsb-release sudo -y
attributes:
poise-service:
redis:
provider: systemd
- name: debian-7
named_run_list: debian
driver:
image: debian:7
pid_one_command: /sbin/init
intermediate_instructions:
- RUN /usr/bin/apt-get update
- RUN /usr/bin/apt-get install lsb-release sudo -y
suites:
- name: default
provisioner:
Expand Down
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cache: bundler
addons:
apt:
sources:
- chef-current-trusty
- chef-stable-trusty
packages:
- chefdk
services: docker
Expand All @@ -30,9 +30,7 @@ before_script:
- eval "$(/opt/chefdk/bin/chef shell-init bash)"
- /opt/chefdk/embedded/bin/chef gem install kitchen-dokken
- /opt/chefdk/embedded/bin/chef --version
- /opt/chefdk/embedded/bin/cookstyle --version
- /opt/chefdk/embedded/bin/foodcritic --version
script: KITCHEN_LOCAL_YAML=.kitchen.dokken.yml kitchen verify ${INSTANCE}
script: kitchen verify ${INSTANCE}
after_script:
- docker images
- docker ps -a
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2015-2016, Bloomberg Finance L.P.
Copyright 2015-2017, Bloomberg Finance L.P.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ high-availability for the database.
## Platforms
The following platforms are tested using [Test Kitchen][5]:

- Ubuntu 12.04/14.04/16.04
- CentOS (RHEL) 5/6/7
- Ubuntu 14.04/16.04
- CentOS (RHEL) 6/7

## Basic Usage
The [default recipe](recipes/default.rb) installs and configures the
Expand Down
4 changes: 1 addition & 3 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
# Cookbook: blp-redis
# License: Apache 2.0
#
# Copyright 2015-2016, Bloomberg Finance L.P.
# Copyright 2015-2017, Bloomberg Finance L.P.
#
default['blp-redis']['provider'] = 'auto'

default['blp-redis']['service_name'] = 'redis'
default['blp-redis']['service_user'] = 'redis'
default['blp-redis']['service_group'] = 'redis'
Expand Down
10 changes: 2 additions & 8 deletions libraries/redis_installation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Cookbook: blp-redis
# License: Apache 2.0
#
# Copyright 2015-2016, Bloomberg Finance L.P.
# Copyright 2015-2017, Bloomberg Finance L.P.
#
require 'poise'

Expand All @@ -23,7 +23,7 @@ class RedisInstallation < Chef::Resource
# @!attribute version
# The version of Redis to install.
# @return [String]
attribute(:version, kind_of: String, name_attribute: true)
attribute(:version, kind_of: String)

# @return [String]
def redis_program
Expand All @@ -49,12 +49,6 @@ module Provider
class RedisInstallation < Chef::Provider
include Poise(inversion: :redis_installation)

# Set the default inversion options.
# @private
def self.default_inversion_options(_node, new_resource)
super.merge(version: new_resource.version)
end

def action_create
notifying_block do
install_redis
Expand Down
6 changes: 3 additions & 3 deletions libraries/redis_installation_archive.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Cookbook: redis
# License: Apache 2.0
#
# Copyright 2015-2016, Bloomberg Finance L.P.
# Copyright 2015-2017, Bloomberg Finance L.P.
#
require 'poise'

Expand All @@ -24,7 +24,7 @@ class RedisInstallationArchive < RedisInstallation
# @api private
def self.default_inversion_options(_node, resource)
super.merge(prefix: '/opt/redis',
version: resource.version,
version: resource.version || '3.2.3',
archive_url: 'http://download.redis.io/releases/redis-%{version}.tar.gz',
archive_checksum: default_archive_checksum(resource))
end
Expand All @@ -50,7 +50,7 @@ def cli_program
# @return [String]
# @api private
def static_folder
::File.join(options[:prefix], new_resource.version)
::File.join(options[:prefix], options[:version])
end

# @param [Chef::Resource] resource
Expand Down
17 changes: 4 additions & 13 deletions libraries/redis_installation_package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Cookbook: blp-redis
# License: Apache 2.0
#
# Copyright 2015-2016, Bloomberg Finance L.P.
# Copyright 2015-2017, Bloomberg Finance L.P.
#
require 'poise'

Expand All @@ -17,24 +17,15 @@ module Provider
class RedisInstallationPackage < RedisInstallation
provides(:package)

# @param [Chef::Node] _node
# @param [Chef::Resource] _resource
# @return [TrueClass, FalseClass]
# @api private
def self.provides_auto?(_node, _resource)
true
end

# @param [Chef::Node] node
# @param [Chef::Resource] new_resource
# @param [Chef::Resource] _resource
# @api private
def self.default_inversion_options(node, new_resource)
package_version = if new_resource.version.nil? || new_resource.version.empty?
default_package_version(node)
else
resource.version
end
super.merge(package_name: default_package_name(node), version: package_version)
def self.default_inversion_options(node, _resource)
super.merge(package_name: default_package_name(node), version: default_package_version(node))
end

# @return [String]
Expand Down
Loading