Puppet Class: profile::memcached::instance

Defined in:
modules/profile/manifests/memcached/instance.pp

Overview

Parameters:

  • version (String) (defaults to: lookup('profile::memcached::version'))
  • port (Stdlib::Port) (defaults to: lookup('profile::memcached::port'))
  • size (Integer) (defaults to: lookup('profile::memcached::size'))
  • extended_options (Array[String]) (defaults to: lookup('profile::memcached::extended_options'))
  • max_seq_reqs (Integer) (defaults to: lookup('profile::memcached::max_seq_reqs'))
  • min_slab_size (Integer) (defaults to: lookup('profile::memcached::min_slab_size'))
  • growth_factor (Float) (defaults to: lookup('profile::memcached::growth_factor'))
  • enable_tls (Optional[Boolean]) (defaults to: lookup('profile::memcached::enable_tls'))
  • notls_port (Optional[Stdlib::Port]) (defaults to: lookup('profile::memcached::notls_port'))
  • ssl_cert (Optional[Stdlib::Unixpath]) (defaults to: lookup('profile::memcached::ssl_cert'))
  • ssl_key (Optional[Stdlib::Unixpath]) (defaults to: lookup('profile::memcached::ssl_key'))
  • enable_16 (Optional[Boolean]) (defaults to: lookup('profile::memcached::enable_16'))
  • threads (Optional[Integer]) (defaults to: lookup('profile::memcached::threads'))


66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'modules/profile/manifests/memcached/instance.pp', line 66

class profile::memcached::instance (
    String                      $version          = lookup('profile::memcached::version'),
    Stdlib::Port                $port             = lookup('profile::memcached::port'),
    Integer                     $size             = lookup('profile::memcached::size'),
    Array[String]               $extended_options = lookup('profile::memcached::extended_options'),
    Integer                     $max_seq_reqs     = lookup('profile::memcached::max_seq_reqs'),
    Integer                     $min_slab_size    = lookup('profile::memcached::min_slab_size'),
    Float                       $growth_factor    = lookup('profile::memcached::growth_factor'),
    Optional[Boolean]           $enable_tls       = lookup('profile::memcached::enable_tls'),
    Optional[Stdlib::Port]      $notls_port       = lookup('profile::memcached::notls_port'),
    Optional[Stdlib::Unixpath]  $ssl_cert         = lookup('profile::memcached::ssl_cert'),
    Optional[Stdlib::Unixpath]  $ssl_key          = lookup('profile::memcached::ssl_key'),
    Optional[Boolean]           $enable_16        = lookup('profile::memcached::enable_16'),
    Optional[Integer]           $threads          = lookup('profile::memcached::threads'),
) {
    include ::profile::prometheus::memcached_exporter

    $base_extra_options = {
        '-o' => join($extended_options, ','),
        '-D' => ':',
    }

    if $max_seq_reqs {
        $max_seq_reqs_opt = {'-R' => $max_seq_reqs}
    } else {
        $max_seq_reqs_opt = {}
    }

    if $threads {
        $threads_opt = {'-t' => $threads}
    } else {
        $threads_opt = {}
    }

    $extra_options = $base_extra_options + $max_seq_reqs_opt + $threads_opt

    class { '::memcached':
        size          => $size,
        port          => $port,
        enable_16     => $enable_16,
        version       => $version,
        growth_factor => $growth_factor,
        min_slab_size => $min_slab_size,
        extra_options => $extra_options,
        enable_tls    => $enable_tls,
        notls_port    => $notls_port,
        ssl_cert      => $ssl_cert,
        ssl_key       => $ssl_key,
    }
    ferm::service { 'memcached':
        proto  => 'tcp',
        port   => $port,
        srange => '$DOMAIN_NETWORKS',
    }
    if $notls_port and $enable_tls {
      ferm::service { 'memcached_notls':
          proto  => 'tcp',
          port   => $notls_port,
          srange => '$DOMAIN_NETWORKS',
      }
    }
}