This cookbook will install Redis Server.
- ubuntu/xenial64
- ubuntu/trusty64
- centos/7
- centos/6
- debian/jessie64
- debian/wheezy64
- Chef '>= 12.5'
- apt
node['redis']['port'] => '6379'
This is the port Redis Server will listen on. Port6379
is the standard port for Redis Server.node['redis']['bind'] => '127.0.0.1'
This is the interface Redis Server will bind to. Use0.0.0.0
to bind to all interfaces.node['redis']['maxmemory'] => '1gb'
This is the maximum amount of memory Redis Server will use. The size is case insensitive.
Here's an example redis
role that will install Redis. This example changes the
memory limit to 4GB.
name 'redis'
description 'install redis'
override_attributes(
'redis' => {
'maxmemory' => '4GB'
}
)
run_list(
'recipe[cop_redis::default]'
)
Testing is handled with ServerSpec, via Test Kitchen, which uses Docker to spin up VMs.
ServerSpec and Test Kitchen are bundled in the ChefDK package.
$ brew cask install chefdk
$ chef gem install kitchen-docker
$ brew install docker docker-machine
$ docker-machine create default --driver virtualbox
Get a listing of your instances with:
$ kitchen list
Run Chef on an instance, in this case default-ubuntu-1204, with:
$ kitchen converge default-ubuntu-1204
Destroy all instances with:
$ kitchen destroy
Run through and test all the instances in serial by running:
$ kitchen test
- The
Berksfile.lock
file has been purposely omitted, as we don't care about upstream dependencies.