redis: Style fixes
This commit is contained in:
parent
9040bf854e
commit
d60056acdb
1 changed files with 53 additions and 56 deletions
|
@ -2,71 +2,68 @@
|
||||||
#
|
#
|
||||||
# === Parameters
|
# === Parameters
|
||||||
#
|
#
|
||||||
# $bind:
|
# $bind:
|
||||||
# Address to bind to. Defaults to "127.0.0.1".
|
# Address to bind to. Defaults to '127.0.0.1'.
|
||||||
#
|
#
|
||||||
# $datadir:
|
# $datadir:
|
||||||
# Directory for redis database dumps.
|
# Directory for redis database dumps.
|
||||||
# Defaults to "/srv/redis".
|
# Defaults to '/srv/redis'.
|
||||||
#
|
#
|
||||||
# $password:
|
# $password:
|
||||||
# Optional password for client connections.
|
# Optional password for client connections.
|
||||||
#
|
#
|
||||||
# $appendonly:
|
# $appendonly:
|
||||||
# Enable append only mode. Defaults to false.
|
# Enable append only mode. Defaults to false.
|
||||||
#
|
#
|
||||||
class redis($bind="127.0.0.1", $datadir="", $password="", $appendonly=false) {
|
class redis(
|
||||||
|
$bind='127.0.0.1',
|
||||||
|
$datadir='/srv/redis',
|
||||||
|
$password=undef,
|
||||||
|
$appendonly=false,
|
||||||
|
) {
|
||||||
|
|
||||||
package { "redis":
|
package { 'redis':
|
||||||
ensure => installed,
|
ensure => installed,
|
||||||
}
|
}
|
||||||
|
|
||||||
if $datadir {
|
if $datadir != '/srv/redis' {
|
||||||
file { $datadir:
|
file { '/srv/redis':
|
||||||
ensure => directory,
|
ensure => link,
|
||||||
mode => "0700",
|
target => $datadir,
|
||||||
owner => "redis",
|
before => Service['redis'],
|
||||||
group => "redis",
|
|
||||||
before => File["/srv/redis"],
|
|
||||||
require => Package["redis"],
|
|
||||||
}
|
|
||||||
file { "/srv/redis":
|
|
||||||
ensure => link,
|
|
||||||
target => $datadir,
|
|
||||||
before => Service["redis"],
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
file { "/srv/redis":
|
|
||||||
ensure => directory,
|
|
||||||
mode => "0700",
|
|
||||||
owner => "redis",
|
|
||||||
group => "redis",
|
|
||||||
before => Service["redis"],
|
|
||||||
require => Package["redis"],
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
augeas { "set-redis-include":
|
file { $datadir:
|
||||||
changes => "set include /etc/redis.local.conf",
|
ensure => directory,
|
||||||
incl => "/etc/redis.conf",
|
mode => '0700',
|
||||||
lens => "Spacevars.simple_lns",
|
owner => 'redis',
|
||||||
notify => Service["redis"],
|
group => 'redis',
|
||||||
require => Package["redis"],
|
before => Service['redis'],
|
||||||
}
|
require => Package['redis'],
|
||||||
|
}
|
||||||
|
|
||||||
file { "/etc/redis.local.conf":
|
augeas { 'set-redis-include':
|
||||||
ensure => present,
|
changes => 'set include /etc/redis.local.conf',
|
||||||
mode => "0600",
|
incl => '/etc/redis.conf',
|
||||||
owner => "redis",
|
lens => 'Spacevars.simple_lns',
|
||||||
group => "redis",
|
notify => Service['redis'],
|
||||||
content => template("redis/local.conf.erb"),
|
require => Package['redis'],
|
||||||
require => Package["redis"],
|
}
|
||||||
notify => Service["redis"],
|
|
||||||
}
|
|
||||||
|
|
||||||
service { "redis":
|
file { '/etc/redis.local.conf':
|
||||||
ensure => running,
|
ensure => present,
|
||||||
enable => true,
|
mode => '0600',
|
||||||
}
|
owner => 'redis',
|
||||||
|
group => 'redis',
|
||||||
|
content => template('redis/local.conf.erb'),
|
||||||
|
notify => Service['redis'],
|
||||||
|
require => Package['redis'],
|
||||||
|
}
|
||||||
|
|
||||||
|
service { 'redis':
|
||||||
|
ensure => running,
|
||||||
|
enable => true,
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue