voxpupuli / puppet-redis

Puppet Module to manage Redis
https://forge.puppet.com/puppet/redis
Apache License 2.0
40 stars 183 forks source link

(#527) Add masteruser parameter #528

Open mrsteffenjo opened 4 months ago

mrsteffenjo commented 4 months ago

Pull Request (PR) description

Enable setting the masteruser parameter which was introduced in Redis 6+ to be able to connect using the new ACL rules.

This Pull Request (PR) fixes the following issues

Fixes #527

mrsteffenjo commented 4 months ago

I don't understand why the target configuration holds the following:

        +# refuse the slave request.
        +#
        +# masterauth <master-password>
        +
        +# However this is not enough if you are using Redis ACLs (for Redis version
        +# 6 or greater), and the default user is not capable of running the PSYNC
        +# command and/or other commands needed for replication. In this case it's
        +# better to configure a special user to use with replication, and specify the
        +# username configuration as such:
        +#
        +# masteruser <master-username>
        +masteruser _VALUE_
        +# When username is specified, the replica will authenticate against its
        +# master using the new AUTH form: AUTH <username> <password>.
        +

that the following test code won't be satisfied:

      describe 'with parameter masteruser' do
        let(:params) do
          {
            masteruser: '_VALUE_'
          }
        end

        it {
          is_expected.to contain_file(config_file_orig).with(
            'content' => %r{masteruser.*'_VALUE_'}
          )
        }
      end

Oh, I see, my IDE surrounded VALUE with single quote marks.

mrsteffenjo commented 4 months ago

Fixed the failed tests