diff --git a/README.md b/README.md
index 32e6fa48..669ce8b5 100644
--- a/README.md
+++ b/README.md
@@ -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).
diff --git a/REFERENCE.md b/REFERENCE.md
index 2737c894..63eb3427 100644
--- a/REFERENCE.md
+++ b/REFERENCE.md
@@ -1451,13 +1451,13 @@ Note that this class requires the herculesteam/augeasproviders_sysctl module.
#### Examples
-#####
+#####
```puppet
include redis::administration
```
-#####
+#####
```puppet
class {'redis::administration':
@@ -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:
@@ -1908,6 +1917,14 @@ Data type: `Stdlib::Ensure::Service`
Default value: `'running'`
+##### `contain_redis`
+
+Data type: `Boolean`
+
+Require redis base class. If set to false, sentinel is installed without redis server.
+
+Default value: `true`
+
## Defined types
### `redis::instance`
@@ -1917,7 +1934,7 @@ multiple redis instances on one machine without conflicts
#### Examples
-#####
+#####
```puppet
redis::instance {'6380':
diff --git a/manifests/sentinel.pp b/manifests/sentinel.pp
index 676ab6e0..33a15111 100644
--- a/manifests/sentinel.pp
+++ b/manifests/sentinel.pp
@@ -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,
@@ -191,6 +194,7 @@
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
@@ -198,13 +202,17 @@
$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]