Skip to content

Commit e4761a0

Browse files
committed
make it possible to install sentinell independently; update MDs; rebase to current master
1 parent 13906e8 commit e4761a0

File tree

3 files changed

+37
-3
lines changed

3 files changed

+37
-3
lines changed

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,15 @@ class { 'redis::sentinel':
133133
}
134134
```
135135

136+
If installation without redis-server is desired, set `require_redis` parameter to false, i.e
137+
```puppet
138+
class { 'redis::sentinel':
139+
...
140+
require_redis => false,
141+
...
142+
}
143+
```
144+
136145
### Soft dependency
137146

138147
When managing the repo, it needs [puppetlabs/apt](https://forge.puppet.com/puppetlabs/apt).

REFERENCE.md

+17
Original file line numberDiff line numberDiff line change
@@ -1509,6 +1509,15 @@ class {'redis::sentinel':
15091509
}
15101510
```
15111511

1512+
If installation without redis-server is desired, set `require_redis` parameter to false, i.e
1513+
```puppet
1514+
class { 'redis::sentinel':
1515+
...
1516+
require_redis => false,
1517+
...
1518+
}
1519+
```
1520+
15121521
#### Parameters
15131522

15141523
The following parameters are available in the `redis::sentinel` class:
@@ -1899,6 +1908,14 @@ Data type: `Stdlib::Ensure::Service`
18991908

19001909
Default value: `'running'`
19011910

1911+
##### <a name="-redis--sentinel--require_redis"></a>`require_redis`
1912+
1913+
Data type: `Boolean`
1914+
1915+
Require redis base class. If set to false, sentinel is installed without redis server.
1916+
1917+
Default value: `true`
1918+
19021919
## Defined types
19031920

19041921
### <a name="redis--instance"></a>`redis::instance`

manifests/sentinel.pp

+11-3
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
# @param acls
134134
# This is a way to pass an array of raw ACLs to Sentinel. The ACLs must be
135135
# in the form of:
136-
#
136+
#
137137
# user USERNAME [additional ACL options]
138138
#
139139
# @example Basic inclusion
@@ -145,6 +145,9 @@
145145
# log_file => '/var/log/redis/sentinel.log',
146146
# }
147147
#
148+
# @param contain_redis
149+
# Contain redis base class. If set to false, sentinel is installed without redis server.
150+
#
148151
class redis::sentinel (
149152
Optional[Variant[String[1], Sensitive[String[1]]]] $auth_pass = undef,
150153
Stdlib::Absolutepath $config_file = $redis::params::sentinel_config_file,
@@ -187,20 +190,25 @@
187190
Optional[Stdlib::Absolutepath] $notification_script = undef,
188191
Optional[Stdlib::Absolutepath] $client_reconfig_script = undef,
189192
Array[String[1]] $acls = [],
193+
Boolean $contain_redis = true,
190194
) inherits redis::params {
191195
$auth_pass_unsensitive = if $auth_pass =~ Sensitive {
192196
$auth_pass.unwrap
193197
} else {
194198
$auth_pass
195199
}
196200

197-
contain 'redis'
201+
if $contain_redis {
202+
contain 'redis'
203+
}
198204

199205
if $package_name != $redis::package_name {
200206
ensure_packages([$package_name], {
201207
ensure => $package_ensure
202208
})
203-
Package[$package_name] -> Class['redis']
209+
if $contain_redis {
210+
Package[$package_name] -> Class['redis']
211+
}
204212
}
205213
Package[$package_name] -> File[$config_file_orig]
206214

0 commit comments

Comments
 (0)