Module: Bcome::Orchestrator::Registry
- Included in:
- Stack::Base
- Defined in:
- lib/orchestrator/registry.rb
Constant Summary collapse
- CONFIGS_PATH =
"bcome/config/orchestration"
Instance Method Summary collapse
- #config_for_registry ⇒ Object
- #do_load_recipes ⇒ Object
- #has_registry_config? ⇒ Boolean
- #load_recipe_registry ⇒ Object
- #recipe_registry ⇒ Object
- #registry_configs_path ⇒ Object
Instance Method Details
#config_for_registry ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/orchestrator/registry.rb', line 10 def config_for_registry return [] unless has_registry_config? matching_keys = [] recipe_registry.keys.each {|registry_key| matching_keys << registry_key if /^#{registry_key}$/.match() } return matching_keys.collect{|registry_key| recipe_registry[registry_key] }.flatten end |
#do_load_recipes ⇒ Object
5 6 7 8 |
# File 'lib/orchestrator/registry.rb', line 5 def do_load_recipes return [] unless config_for_registry.any? ::Bcome::Orchestrator::Loader.new(machines, config_for_registry).recipes end |
#has_registry_config? ⇒ Boolean
33 34 35 |
# File 'lib/orchestrator/registry.rb', line 33 def has_registry_config? File.exist?(registry_configs_path) end |
#load_recipe_registry ⇒ Object
25 26 27 |
# File 'lib/orchestrator/registry.rb', line 25 def load_recipe_registry return YAML.load_file(registry_configs_path) end |
#recipe_registry ⇒ Object
21 22 23 |
# File 'lib/orchestrator/registry.rb', line 21 def recipe_registry load_recipe_registry end |
#registry_configs_path ⇒ Object
29 30 31 |
# File 'lib/orchestrator/registry.rb', line 29 def registry_configs_path "#{CONFIGS_PATH}/registry.yml" end |