Module: PuppetX::Keycloak::Type

Defined in:
lib/puppet_x/keycloak/type.rb

Overview

Module for shared type configs

Instance Method Summary collapse

Instance Method Details

#add_autorequires(realm = true) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/puppet_x/keycloak/type.rb', line 7

def add_autorequires(realm = true)
  autorequire(:keycloak_conn_validator) do
    requires = []
    catalog.resources.each do |resource|
      if resource.instance_of?(::Puppet::Type::Keycloak_conn_validator)
        requires << resource.name
      end
    end
    requires
  end

  autorequire(:file) do
    ['kcadm-wrapper.sh']
  end

  if realm # rubocop:disable Style/GuardClause
    autorequire(:keycloak_realm) do
      [self[:realm]]
    end
  end
end