Open johnkazmerzak opened 2 years ago
this actually made secrets management unusable with new module
I've created a hackish, drop-in replacement for elasticsearch_keystore provider: https://github.com/psychonaut/puppet-elasticsearch/blob/keystore/lib/puppet/provider/elasticsearch_keystore/ruby.rb - it works but to be honest, I don't like this approach: since in new module there's only one keystore there's no point of creating resource for keystore. Moreover, even in the old instance version, it didn't check the value of the secret, it only checked if a secret with this name exists.
The new approach should be built around secrets, not keystores. So instead of
elasticsearch_keystore { 'whatever': # it's no longer relevant what you put here since there's only one keystore
..
settings => {secret1_key => secret1_value, secret2_key => secret2_value},
}
it should be
elasticsearch_secret { 'secret_key':
ensure => absent|present
value => secret_value,
}
Here is another "dirty" solution similar to the one provided by @psychonaut but also solves #983 https://github.com/victorvarias/puppet-elasticsearch/commit/1b02c895459b4706468e259166ed2c8b3c6ea66f
Affected Puppet, Ruby, OS and module versions/distributions
How to reproduce (e.g Puppet code you use)
What are you seeing
Could not evaluate: Execution of '/usr/share/elasticsearch/bin/elasticsearch-keystore create' returned 1:
What behaviour did you expect instead
Successful execution of elasticsearch_keystore resource
Output log
Any additional information you'd like to impart
The resource fails because of legacy instance configuration in this definition, https://github.com/voxpupuli/puppet-elasticsearch/blob/7ef798331104790bda4fc900586cb29af4d86bef/lib/puppet/provider/elasticsearch_keystore/ruby.rb#L30