Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make it possible to install sentinell independently; update MDs
Browse files Browse the repository at this point in the history
tomsajan committed Aug 5, 2024
1 parent 9881323 commit a290a1b
Showing 3 changed files with 33 additions and 1 deletion.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -133,6 +133,15 @@ class { '::redis::sentinel':
}
```

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

### Soft dependency

When managing the repo, it either needs [puppetlabs/apt](https://forge.puppet.com/puppetlabs/apt) or [puppet/epel](https://forge.puppet.com/puppet/epel).
17 changes: 17 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
@@ -1468,6 +1468,15 @@ class {'redis::sentinel':
}
```

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

#### Parameters

The following parameters are available in the `redis::sentinel` class:
@@ -1846,6 +1855,14 @@ Data type: `Stdlib::Ensure::Service`

Default value: `'running'`

##### <a name="-redis--sentinel--require_redis"></a>`require_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`
8 changes: 7 additions & 1 deletion manifests/sentinel.pp
Original file line number Diff line number Diff line change
@@ -139,6 +139,9 @@
# log_file => '/var/log/redis/sentinel.log',
# }
#
# @param require_redis
# Require 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,
@@ -180,14 +183,17 @@
Stdlib::Absolutepath $working_dir = $redis::params::sentinel_working_dir,
Optional[Stdlib::Absolutepath] $notification_script = undef,
Optional[Stdlib::Absolutepath] $client_reconfig_script = undef,
Boolean $require_redis = true,
) inherits redis::params {
$auth_pass_unsensitive = if $auth_pass =~ Sensitive {
$auth_pass.unwrap
} else {
$auth_pass
}

require 'redis'
if $require_redis {
require 'redis'
}

if $package_name != $redis::package_name {
ensure_packages([$package_name], {

0 comments on commit a290a1b

Please sign in to comment.