|
501 | 501 |
|
502 | 502 | $bind_arr = [$bind].flatten
|
503 | 503 |
|
| 504 | + $_template_params = { |
| 505 | + daemonize => $daemonize, |
| 506 | + pid_file => $pid_file, |
| 507 | + protected_mode => $protected_mode, |
| 508 | + port => $port, |
| 509 | + tcp_backlog => $tcp_backlog, |
| 510 | + bind_arr => $bind_arr, |
| 511 | + unixsocket => $unixsocket, |
| 512 | + unixsocketperm => $unixsocketperm, |
| 513 | + timeout => $timeout, |
| 514 | + tcp_keepalive => $tcp_keepalive, |
| 515 | + log_level => $log_level, |
| 516 | + log_file => $_real_log_file, |
| 517 | + syslog_enabled => $syslog_enabled, |
| 518 | + syslog_facility => $syslog_facility, |
| 519 | + databases => $databases, |
| 520 | + save_db_to_disk => $save_db_to_disk, |
| 521 | + save_db_to_disk_interval => $save_db_to_disk_interval, |
| 522 | + stop_writes_on_bgsave_error => $stop_writes_on_bgsave_error, |
| 523 | + rdbcompression => $rdbcompression, |
| 524 | + dbfilename => $dbfilename, |
| 525 | + workdir => $workdir, |
| 526 | + slaveof => $slaveof, |
| 527 | + replicaof => $replicaof, |
| 528 | + masterauth => $masterauth, |
| 529 | + slave_serve_stale_data => $slave_serve_stale_data, |
| 530 | + slave_read_only => $slave_read_only, |
| 531 | + repl_announce_ip => $repl_announce_ip, |
| 532 | + repl_announce_port => $repl_announce_port, |
| 533 | + repl_ping_slave_period => $repl_ping_slave_period, |
| 534 | + repl_timeout => $repl_timeout, |
| 535 | + repl_disable_tcp_nodelay => $repl_disable_tcp_nodelay, |
| 536 | + repl_backlog_size => $repl_backlog_size, |
| 537 | + repl_backlog_ttl => $repl_backlog_ttl, |
| 538 | + slave_priority => $slave_priority, |
| 539 | + min_slaves_to_write => $min_slaves_to_write, |
| 540 | + min_slaves_max_lag => $min_slaves_max_lag, |
| 541 | + requirepass => $requirepass, |
| 542 | + rename_commands => $rename_commands, |
| 543 | + maxclients => $maxclients, |
| 544 | + maxmemory => $maxmemory, |
| 545 | + maxmemory_policy => $maxmemory_policy, |
| 546 | + maxmemory_samples => $maxmemory_samples, |
| 547 | + appendonly => $appendonly, |
| 548 | + appendfilename => $appendfilename, |
| 549 | + appendfsync => $appendfsync, |
| 550 | + no_appendfsync_on_rewrite => $no_appendfsync_on_rewrite, |
| 551 | + auto_aof_rewrite_percentage => $auto_aof_rewrite_percentage, |
| 552 | + auto_aof_rewrite_min_size => $auto_aof_rewrite_min_size, |
| 553 | + aof_load_truncated => $aof_load_truncated, |
| 554 | + slowlog_log_slower_than => $slowlog_log_slower_than, |
| 555 | + slowlog_max_len => $slowlog_max_len, |
| 556 | + latency_monitor_threshold => $latency_monitor_threshold, |
| 557 | + notify_keyspace_events => $notify_keyspace_events, |
| 558 | + hash_max_ziplist_entries => $hash_max_ziplist_entries, |
| 559 | + hash_max_ziplist_value => $hash_max_ziplist_value, |
| 560 | + list_max_ziplist_entries => $list_max_ziplist_entries, |
| 561 | + list_max_ziplist_value => $list_max_ziplist_value, |
| 562 | + set_max_intset_entries => $set_max_intset_entries, |
| 563 | + zset_max_ziplist_entries => $zset_max_ziplist_entries, |
| 564 | + zset_max_ziplist_value => $zset_max_ziplist_value, |
| 565 | + hll_sparse_max_bytes => $hll_sparse_max_bytes, |
| 566 | + activerehashing => $activerehashing, |
| 567 | + output_buffer_limit_slave => $output_buffer_limit_slave, |
| 568 | + output_buffer_limit_pubsub => $output_buffer_limit_pubsub, |
| 569 | + hz => $hz, |
| 570 | + aof_rewrite_incremental_fsync => $aof_rewrite_incremental_fsync, |
| 571 | + cluster_enabled => $cluster_enabled, |
| 572 | + cluster_config_file => $cluster_config_file, |
| 573 | + cluster_node_timeout => $cluster_node_timeout, |
| 574 | + cluster_slave_validity_factor => $cluster_slave_validity_factor, |
| 575 | + cluster_require_full_coverage => $cluster_require_full_coverage, |
| 576 | + cluster_migration_barrier => $cluster_migration_barrier, |
| 577 | + extra_config_file => $extra_config_file, |
| 578 | + tls_port => $tls_port, |
| 579 | + tls_cert_file => $tls_cert_file, |
| 580 | + tls_key_file => $tls_key_file, |
| 581 | + tls_ca_cert_file => $tls_ca_cert_file, |
| 582 | + tls_ca_cert_dir => $tls_ca_cert_dir, |
| 583 | + tls_ciphers => $tls_ciphers, |
| 584 | + tls_ciphersuites => $tls_ciphersuites, |
| 585 | + tls_protocols => $tls_protocols, |
| 586 | + tls_auth_clients => $tls_auth_clients, |
| 587 | + tls_replication => $tls_replication, |
| 588 | + tls_cluster => $tls_cluster, |
| 589 | + tls_prefer_server_ciphers => $tls_prefer_server_ciphers, |
| 590 | + modules => $modules, |
| 591 | + io_threads => $io_threads, |
| 592 | + io_threads_do_reads => $io_threads_do_reads, |
| 593 | + cluster_allow_reads_when_down => $cluster_allow_reads_when_down, |
| 594 | + cluster_replica_no_failover => $cluster_replica_no_failover, |
| 595 | + dynamic_hz => $dynamic_hz, |
| 596 | + activedefrag => $activedefrag, |
| 597 | + active_defrag_ignore_bytes => $active_defrag_ignore_bytes, |
| 598 | + active_defrag_threshold_lower => $active_defrag_threshold_lower, |
| 599 | + active_defrag_threshold_upper => $active_defrag_threshold_upper, |
| 600 | + active_defrag_cycle_min => $active_defrag_cycle_min, |
| 601 | + active_defrag_cycle_max => $active_defrag_cycle_max, |
| 602 | + active_defrag_max_scan_fields => $active_defrag_max_scan_fields, |
| 603 | + jemalloc_bg_thread => $jemalloc_bg_thread, |
| 604 | + rdb_save_incremental_fsync => $rdb_save_incremental_fsync, |
| 605 | + acls => $acls, |
| 606 | + custom_options => $custom_options, |
| 607 | + } |
| 608 | + |
| 609 | + # TODO: Rely on https://github.com/puppetlabs/puppetlabs-stdlib/pull/1425 |
| 610 | + # once available. |
| 611 | + if $_template_params.any |$_key, $_value| { $_value.is_a(Deferred) } { |
| 612 | + $_template_params_escaped = $_template_params.map | $_var , $_value | { |
| 613 | + if $_value.is_a(Deferred) { |
| 614 | + { $_var => "<%= \$${_var} %>" } |
| 615 | + } else { |
| 616 | + { $_var => $_value } |
| 617 | + } |
| 618 | + }.reduce | $_memo, $_kv | { $_memo + $_kv } |
| 619 | + |
| 620 | + $_content = Deferred( |
| 621 | + 'inline_epp', |
| 622 | + [ |
| 623 | + epp($conf_template,$_template_params_escaped), |
| 624 | + $_template_params, |
| 625 | + ] |
| 626 | + ) |
| 627 | + } else { |
| 628 | + $_content = epp($conf_template, $_template_params) |
| 629 | + } |
| 630 | + |
504 | 631 | file { $redis_file_name_orig:
|
505 | 632 | ensure => file,
|
506 | 633 | owner => $config_owner,
|
507 | 634 | group => $config_group,
|
508 | 635 | mode => $config_file_mode,
|
509 |
| - content => stdlib::deferrable_epp( |
510 |
| - $conf_template, |
511 |
| - { |
512 |
| - daemonize => $daemonize, |
513 |
| - pid_file => $pid_file, |
514 |
| - protected_mode => $protected_mode, |
515 |
| - port => $port, |
516 |
| - tcp_backlog => $tcp_backlog, |
517 |
| - bind_arr => $bind_arr, |
518 |
| - unixsocket => $unixsocket, |
519 |
| - unixsocketperm => $unixsocketperm, |
520 |
| - timeout => $timeout, |
521 |
| - tcp_keepalive => $tcp_keepalive, |
522 |
| - log_level => $log_level, |
523 |
| - log_file => $_real_log_file, |
524 |
| - syslog_enabled => $syslog_enabled, |
525 |
| - syslog_facility => $syslog_facility, |
526 |
| - databases => $databases, |
527 |
| - save_db_to_disk => $save_db_to_disk, |
528 |
| - save_db_to_disk_interval => $save_db_to_disk_interval, |
529 |
| - stop_writes_on_bgsave_error => $stop_writes_on_bgsave_error, |
530 |
| - rdbcompression => $rdbcompression, |
531 |
| - dbfilename => $dbfilename, |
532 |
| - workdir => $workdir, |
533 |
| - slaveof => $slaveof, |
534 |
| - replicaof => $replicaof, |
535 |
| - masterauth => $masterauth, |
536 |
| - slave_serve_stale_data => $slave_serve_stale_data, |
537 |
| - slave_read_only => $slave_read_only, |
538 |
| - repl_announce_ip => $repl_announce_ip, |
539 |
| - repl_announce_port => $repl_announce_port, |
540 |
| - repl_ping_slave_period => $repl_ping_slave_period, |
541 |
| - repl_timeout => $repl_timeout, |
542 |
| - repl_disable_tcp_nodelay => $repl_disable_tcp_nodelay, |
543 |
| - repl_backlog_size => $repl_backlog_size, |
544 |
| - repl_backlog_ttl => $repl_backlog_ttl, |
545 |
| - slave_priority => $slave_priority, |
546 |
| - min_slaves_to_write => $min_slaves_to_write, |
547 |
| - min_slaves_max_lag => $min_slaves_max_lag, |
548 |
| - requirepass => $requirepass, |
549 |
| - rename_commands => $rename_commands, |
550 |
| - maxclients => $maxclients, |
551 |
| - maxmemory => $maxmemory, |
552 |
| - maxmemory_policy => $maxmemory_policy, |
553 |
| - maxmemory_samples => $maxmemory_samples, |
554 |
| - appendonly => $appendonly, |
555 |
| - appendfilename => $appendfilename, |
556 |
| - appendfsync => $appendfsync, |
557 |
| - no_appendfsync_on_rewrite => $no_appendfsync_on_rewrite, |
558 |
| - auto_aof_rewrite_percentage => $auto_aof_rewrite_percentage, |
559 |
| - auto_aof_rewrite_min_size => $auto_aof_rewrite_min_size, |
560 |
| - aof_load_truncated => $aof_load_truncated, |
561 |
| - slowlog_log_slower_than => $slowlog_log_slower_than, |
562 |
| - slowlog_max_len => $slowlog_max_len, |
563 |
| - latency_monitor_threshold => $latency_monitor_threshold, |
564 |
| - notify_keyspace_events => $notify_keyspace_events, |
565 |
| - hash_max_ziplist_entries => $hash_max_ziplist_entries, |
566 |
| - hash_max_ziplist_value => $hash_max_ziplist_value, |
567 |
| - list_max_ziplist_entries => $list_max_ziplist_entries, |
568 |
| - list_max_ziplist_value => $list_max_ziplist_value, |
569 |
| - set_max_intset_entries => $set_max_intset_entries, |
570 |
| - zset_max_ziplist_entries => $zset_max_ziplist_entries, |
571 |
| - zset_max_ziplist_value => $zset_max_ziplist_value, |
572 |
| - hll_sparse_max_bytes => $hll_sparse_max_bytes, |
573 |
| - activerehashing => $activerehashing, |
574 |
| - output_buffer_limit_slave => $output_buffer_limit_slave, |
575 |
| - output_buffer_limit_pubsub => $output_buffer_limit_pubsub, |
576 |
| - hz => $hz, |
577 |
| - aof_rewrite_incremental_fsync => $aof_rewrite_incremental_fsync, |
578 |
| - cluster_enabled => $cluster_enabled, |
579 |
| - cluster_config_file => $cluster_config_file, |
580 |
| - cluster_node_timeout => $cluster_node_timeout, |
581 |
| - cluster_slave_validity_factor => $cluster_slave_validity_factor, |
582 |
| - cluster_require_full_coverage => $cluster_require_full_coverage, |
583 |
| - cluster_migration_barrier => $cluster_migration_barrier, |
584 |
| - extra_config_file => $extra_config_file, |
585 |
| - tls_port => $tls_port, |
586 |
| - tls_cert_file => $tls_cert_file, |
587 |
| - tls_key_file => $tls_key_file, |
588 |
| - tls_ca_cert_file => $tls_ca_cert_file, |
589 |
| - tls_ca_cert_dir => $tls_ca_cert_dir, |
590 |
| - tls_ciphers => $tls_ciphers, |
591 |
| - tls_ciphersuites => $tls_ciphersuites, |
592 |
| - tls_protocols => $tls_protocols, |
593 |
| - tls_auth_clients => $tls_auth_clients, |
594 |
| - tls_replication => $tls_replication, |
595 |
| - tls_cluster => $tls_cluster, |
596 |
| - tls_prefer_server_ciphers => $tls_prefer_server_ciphers, |
597 |
| - modules => $modules, |
598 |
| - io_threads => $io_threads, |
599 |
| - io_threads_do_reads => $io_threads_do_reads, |
600 |
| - cluster_allow_reads_when_down => $cluster_allow_reads_when_down, |
601 |
| - cluster_replica_no_failover => $cluster_replica_no_failover, |
602 |
| - dynamic_hz => $dynamic_hz, |
603 |
| - activedefrag => $activedefrag, |
604 |
| - active_defrag_ignore_bytes => $active_defrag_ignore_bytes, |
605 |
| - active_defrag_threshold_lower => $active_defrag_threshold_lower, |
606 |
| - active_defrag_threshold_upper => $active_defrag_threshold_upper, |
607 |
| - active_defrag_cycle_min => $active_defrag_cycle_min, |
608 |
| - active_defrag_cycle_max => $active_defrag_cycle_max, |
609 |
| - active_defrag_max_scan_fields => $active_defrag_max_scan_fields, |
610 |
| - jemalloc_bg_thread => $jemalloc_bg_thread, |
611 |
| - rdb_save_incremental_fsync => $rdb_save_incremental_fsync, |
612 |
| - acls => $acls, |
613 |
| - custom_options => $custom_options, |
614 |
| - } |
615 |
| - ), |
| 636 | + content => $_content, |
616 | 637 | }
|
617 | 638 |
|
618 | 639 | exec { "copy ${redis_file_name_orig} to ${redis_file_name}":
|
|
0 commit comments