File: ruby.rb

package info (click to toggle)
puppet-module-voxpupuli-elasticsearch 9.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,496 kB
  • sloc: ruby: 9,906; sh: 392; makefile: 4
file content (30 lines) | stat: -rw-r--r-- 664 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# frozen_string_literal: true

require 'puppet/provider/elastic_parsedfile'

Puppet::Type.type(:elasticsearch_user_file).provide(
  :ruby,
  parent: Puppet::Provider::ElasticParsedFile
) do
  desc 'Provider for X-Pack elasticsearch users using plain files.'

  xpack_config 'users'

  has_feature :manages_encrypted_passwords

  text_line :comment,
            match: %r{^\s*#}

  record_line :ruby,
              fields: %w[name hashed_password],
              separator: ':',
              joiner: ':'

  def self.valid_attr?(klass, attr_name)
    if klass.respond_to? :parameters
      klass.parameters.include?(attr_name)
    else
      true
    end
  end
end