redis

approved
tasks
Redis module

Vox Pupuli

puppet

675,943 downloads

14,934 latest version

5.0 quality score

Version information

  • 6.1.0 (latest)
  • 6.0.0
  • 5.0.0
  • 4.2.1
  • 4.2.0
  • 4.1.0
  • 4.0.0
released Sep 11th 2020
This version is compatible with:
  • Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x
  • Puppet >= 5.5.8 < 7.0.0
  • Debian
    ,
    Ubuntu
    ,
    RedHat
    ,
    CentOS
    , Archlinux
Tasks:
  • redis_cli

Start using this module

Documentation

puppet/redis — version 6.1.0 Sep 11th 2020

Puppet Redis

License Build Status Code Coverage Puppet Forge Puppet Forge - downloads Puppet Forge - endorsement Puppet Forge - scores

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,
}

Multiple instances

$listening_ports = [6379,6380,6381,6382]

class { '::redis':
  default_install => false,
  service_enable  => false,
  service_ensure  => 'stopped',
}

$listening_ports.each |$port| {
  $port_string = sprintf('%d',$port)
  redis::instance { $port_string:
    service_enable => true,
    service_ensure => 'running',
    port           => $port,
    bind           => $facts['networking']['ip'],
    dbfilename     => "${port}-dump.rdb",
    appendfilename => "${port}-appendonly.aof",
    appendfsync    => 'always',
    require        => Class['Redis'],
  }
}

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',
}

Warning note that it requires puppetlabs/apt on Debian or Ubuntu distros. On Red Hat puppet/epel is needed unless the installation is using Software Collections. In that case will install centos-release-scl-rh from CentOS extras. For RHEL or other RHEL-derivatives this isn't managed.

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,
}

Soft dependency

This module requires camptocamp/systemd on Puppet versions older than 6.1.0.

When managing the repo, it either needs puppetlabs/apt or puppet/epel.

redis::get() function

This function is used to get data from redis. You must have the 'redis' gem installed on your puppet master.

Functions are documented in REFERENCE.md