Module: DopCommon::Node::Config
- Included in:
- DopCommon::Node
- Defined in:
- lib/dop_common/node/config.rb
Constant Summary collapse
- @@mutex_hiera =
Mutex.new
- @@mutex_lookup =
Mutex.new
- @@hiera =
nil
- @@hiera_config =
nil
Instance Method Summary collapse
- #config(variable) ⇒ Object
- #config_includes?(variable, pattern) ⇒ Boolean
- #fact(variable) ⇒ Object
- #has_config?(variable, pattern) ⇒ Boolean
- #has_fact?(variable, pattern) ⇒ Boolean
- #has_name?(pattern) ⇒ Boolean
- #has_role?(pattern) ⇒ Boolean
- #role ⇒ Object
Instance Method Details
#config(variable) ⇒ Object
17 18 19 |
# File 'lib/dop_common/node/config.rb', line 17 def config(variable) resolve_external(variable) || resolve_internal(variable) end |
#config_includes?(variable, pattern) ⇒ Boolean
25 26 27 |
# File 'lib/dop_common/node/config.rb', line 25 def config_includes?(variable, pattern) [config(variable)].flatten.any?{|v| pattern_match?(v, pattern)} end |
#fact(variable) ⇒ Object
29 30 31 |
# File 'lib/dop_common/node/config.rb', line 29 def fact(variable) scope[ensure_global_namespace(variable)] end |
#has_config?(variable, pattern) ⇒ Boolean
21 22 23 |
# File 'lib/dop_common/node/config.rb', line 21 def has_config?(variable, pattern) pattern_match?(config(variable), pattern) end |
#has_fact?(variable, pattern) ⇒ Boolean
33 34 35 |
# File 'lib/dop_common/node/config.rb', line 33 def has_fact?(variable, pattern) pattern_match?(fact(variable), pattern) end |
#has_name?(pattern) ⇒ Boolean
13 14 15 |
# File 'lib/dop_common/node/config.rb', line 13 def has_name?(pattern) pattern_match?(name, pattern) end |
#has_role?(pattern) ⇒ Boolean
41 42 43 |
# File 'lib/dop_common/node/config.rb', line 41 def has_role?(pattern) pattern_match?(role, pattern) end |