Forge Home

redis

Redis module

2,724,730 downloads

1,416,188 latest version

4.6 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 3.3.0 (latest)
  • 3.2.0
  • 3.1.0
  • 3.0.0
  • 1.2.4
  • 1.2.3
  • 1.2.2
  • 1.2.1
  • 1.2.0
  • 1.1.3
  • 1.1.2
  • 1.1.1
  • 1.1.0
  • 1.0.7
  • 1.0.6
  • 1.0.5
  • 1.0.4
  • 1.0.3
  • 1.0.2
  • 1.0.1
  • 1.0.0
  • 0.0.10
  • 0.0.9
  • 0.0.7
  • 0.0.6
  • 0.0.5
  • 0.0.4
  • 0.0.3
  • 0.0.2
  • 0.0.1
released Jun 19th 2018
This version is compatible with:
  • , , , , Archlinux
This module has been deprecated by its author since Mar 15th 2019.

The author has suggested puppet-redis as its replacement.

Tasks:
  • redis_cli

Start using this module

Documentation

arioch/redis — version 3.3.0 Jun 19th 2018

Puppet Redis

Build status

Build Status

Example usage

Standalone

include ::redis

Master node

class { '::redis':
  bind => '10.0.1.1',
}

With authentication

class { '::redis':
  bind       => '10.0.1.1',
  masterauth => 'secret',
}

Slave node

class { '::redis':
  bind    => '10.0.1.2',
  slaveof => '10.0.1.1 6379',
}

With authentication

class { '::redis':
  bind       => '10.0.1.2',
  slaveof    => '10.0.1.1 6379',
  masterauth => 'secret',
}

Redis 3.0 Clustering

class { '::redis':
  bind                 => '10.0.1.2',
  appendonly           => true,
  cluster_enabled      => true,
  cluster_config_file  => 'nodes.conf',
  cluster_node_timeout => 5000,
}

Manage repositories

Disabled by default but if you really want the module to manage the required repositories you can use this snippet:

class { '::redis':
  manage_repo => true,
}

On Ubuntu, "chris-lea/redis-server" ppa repo will be added. You can change it by using ppa_repo parameter:

class { '::redis':
  manage_repo => true,
  ppa_repo    => 'ppa:rwky/redis',
}

Redis Sentinel

Optionally install and configuration a redis-sentinel server.

With default settings:

include ::redis::sentinel

With adjustments:

class { '::redis::sentinel':
  master_name      => 'cow',
  redis_host       => '192.168.1.5',
  failover_timeout => 30000,
}

redisget() function

redisget() takes two or three arguments that are strings. The first is the key to be looked up, the second is the URL to the Redis service and the optional third argument is a default value to use if the key is not found or connection to the Redis service cannot be made.

Example of basic usage.

$version = redisget('version.myapp', 'redis://redis.example.com:6379')

Example with default value specified. This is useful to allow for cached data in case Redis is not available.

$version = redisget('version.myapp', 'redis://redis.example.com:6379', $::myapp_version)

You must have the 'redis' gem installed on your puppet master.

Unit testing

Plain RSpec:

$ rake spec

Using bundle:

$ bundle exec rake spec

Test against a specific Puppet or Facter version:

$ PUPPET_VERSION=3.2.1  bundle update && bundle exec rake spec
$ PUPPET_VERSION=4.10.0 bundle update && bundle exec rake spec
$ FACTER_VERSION=1.6.8  bundle update && bundle exec rake spec

Puppet 3 Support

Puppet 3 is EOL as-of January 2017. The last release of this module that will support Puppet 3.X and earlier will be the 3.X.X module releases.

Module versions from 4.X.X onwards will use Puppet 4 only features and will not work with earlier versions.

We would recommend upgrading your Puppet agent to the latest release, as Puppet 4 comes with a load of awesome new features.

If you're stuck with older Puppet, you could also fork the module from 3.0.0 and use your fork as a Puppet 3 supported version.

Contributing

  • Fork it
  • Create a feature branch (git checkout -b my-new-feature)
  • Run rspec tests (bundle exec rake spec)
  • Commit your changes (git commit -am 'Added some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create new Pull Request