Skip to content

Commit

Permalink
make it possible to install sentinell independently; update MDs
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsajan committed Aug 5, 2024
1 parent 9881323 commit a290a1b
Show file tree
Hide file tree
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
Expand Up @@ -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).
Expand Down
17 changes: 17 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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`
Expand Down
8 changes: 7 additions & 1 deletion manifests/sentinel.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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], {
Expand Down

0 comments on commit a290a1b

Please sign in to comment.