forked from voxpupuli/puppet-redis
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support rich datatypes and deferred password values
Process the configuration file `redis.conf` template twice if some of the templates values are deferred. Currently with deferred values the resulting deferred template cannot be processed since it contains complex datatypes from stdlib in particular. This is a redis specific solution that may arrive genraly one day in puppetlabs/puppetlabs-stdlib#1425
- Loading branch information
1 parent
74fdaf6
commit 0e2d97e
Showing
2 changed files
with
155 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper_acceptance' | ||
|
||
describe 'redis with deferred password' do | ||
include_examples 'an idempotent resource' do | ||
let(:manifest) do | ||
<<-PUPPET | ||
class { 'redis': | ||
manage_repo => true, | ||
redis_apt_repo => true, | ||
port => 10001, | ||
requirepass => Deferred('inline_epp',['<%= $pass %>',{'pass' => 'topsecret'}]), | ||
} | ||
PUPPET | ||
end | ||
end | ||
|
||
describe command('redis-cli -p 10001 -a topsecret ping') do | ||
its(:exit_status) { is_expected.to eq 0 } | ||
its(:stdout) { is_expected.to match %r{PONG} } | ||
end | ||
|
||
describe command('redis-cli -p 10001 -a nonsense ping') do | ||
its(:stdout) { is_expected.not_to match %r{PONG} } | ||
end | ||
end |