Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support deferred values for requirepass #473

Closed
ThiefMaster opened this issue May 26, 2023 · 1 comment · Fixed by #476
Closed

Support deferred values for requirepass #473

ThiefMaster opened this issue May 26, 2023 · 1 comment · Fixed by #476

Comments

@ThiefMaster
Copy link
Contributor

This requires a fairly recent stdlib (8.x), but It would be really useful if the requirepass value could be a deferred value.

I'm using this patch in my environment and it works well:

diff --git a/code/manifests/instance.pp b/code/manifests/instance.pp
index 1f97830..63b5d5f 100644
--- a/code/manifests/instance.pp
+++ b/code/manifests/instance.pp
@@ -327,7 +327,7 @@ define redis::instance (
   Boolean $repl_disable_tcp_nodelay                              = $redis::repl_disable_tcp_nodelay,
   Integer[1] $repl_ping_slave_period                             = $redis::repl_ping_slave_period,
   Integer[1] $repl_timeout                                       = $redis::repl_timeout,
-  Optional[String] $requirepass                                  = $redis::requirepass,
+  Optional[Variant[String, Deferred]] $requirepass               = $redis::requirepass,
   Boolean $save_db_to_disk                                       = $redis::save_db_to_disk,
   Hash $save_db_to_disk_interval                                 = $redis::save_db_to_disk_interval,
   String[1] $service_user                                        = $redis::service_user,
@@ -481,7 +481,7 @@ define redis::instance (
     owner   => $config_owner,
     group   => $config_group,
     mode    => $config_file_mode,
-    content => epp(
+    content => stdlib::deferrable_epp(
       $conf_template,
       {
         daemonize                     => $daemonize,

I could send a PR that also adds it in other places (I just patched this one because that's the one I'm using) but honestly I'm not an expert when it comes to Puppet modules, so it would probably not contain tests and it would require a fairly big bump of the required stdlib version.

Let me know if this is something you're interested in.

@ThiefMaster
Copy link
Contributor Author

@bastelfreak ping :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant