Skip to content
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
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,15 @@ class { 'redis::sentinel':
}
```

If installation without redis-server is desired, set `contain_redis` parameter to false, i.e
```puppet
class { 'redis::sentinel':
...
contain_redis => false,
...
}
```

### Soft dependency

When managing the repo, it needs [puppetlabs/apt](https://forge.puppet.com/puppetlabs/apt).
Expand Down
23 changes: 20 additions & 3 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -1451,13 +1451,13 @@ Note that this class requires the herculesteam/augeasproviders_sysctl module.

#### Examples

#####
#####

```puppet
include redis::administration
```

#####
#####

```puppet
class {'redis::administration':
Expand Down Expand Up @@ -1509,6 +1509,15 @@ class {'redis::sentinel':
}
```

If installation without redis-server is desired, set `contain_redis` parameter to false, i.e
```puppet
class { 'redis::sentinel':
...
contain_redis => false,
...
}
```

#### Parameters

The following parameters are available in the `redis::sentinel` class:
Expand Down Expand Up @@ -1908,6 +1917,14 @@ Data type: `Stdlib::Ensure::Service`

Default value: `'running'`

##### <a name="-redis--sentinel--contain_redis"></a>`contain_redis`

Data type: `Boolean`

Require redis base class. If set to false, sentinel is installed without redis server.

Default value: `true`

## Defined types

### <a name="redis--instance"></a>`redis::instance`
Expand All @@ -1917,7 +1934,7 @@ multiple redis instances on one machine without conflicts

#### Examples

#####
#####

```puppet
redis::instance {'6380':
Expand Down
12 changes: 10 additions & 2 deletions manifests/sentinel.pp
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@
# log_file => '/var/log/redis/sentinel.log',
# }
#
# @param contain_redis
# Contain redis base class. If set to false, sentinel is installed without redis server.
#
class redis::sentinel (
Optional[Variant[String[1], Sensitive[String[1]]]] $auth_pass = undef,
Stdlib::Absolutepath $config_file = $redis::params::sentinel_config_file,
Expand Down Expand Up @@ -191,20 +194,25 @@
Optional[Stdlib::Absolutepath] $notification_script = undef,
Optional[Stdlib::Absolutepath] $client_reconfig_script = undef,
Array[String[1]] $acls = [],
Boolean $contain_redis = true,
) inherits redis::params {
$auth_pass_unsensitive = if $auth_pass =~ Sensitive {
$auth_pass.unwrap
} else {
$auth_pass
}

contain 'redis'
if $contain_redis {
contain 'redis'
}

if $package_name != $redis::package_name {
stdlib::ensure_packages([$package_name], {
ensure => $package_ensure
})
Package[$package_name] -> Class['redis']
if $contain_redis {
Package[$package_name] -> Class['redis']
}
}
Package[$package_name] -> File[$config_file_orig]

Expand Down
Loading