Class: Nucleon::Action::Node::Provision
- Inherits:
-
Object
- Object
- Nucleon::Action::Node::Provision
- Defined in:
- lib/nucleon/action/node/provision.rb
Class Method Summary collapse
-
.describe ⇒ Object
—————————————————————————– Info.
Instance Method Summary collapse
-
#arguments ⇒ Object
—.
-
#configure ⇒ Object
—————————————————————————– Settings.
-
#execute ⇒ Object
—————————————————————————– Operations.
Class Method Details
.describe ⇒ Object
Info
10 11 12 |
# File 'lib/nucleon/action/node/provision.rb', line 10 def self.describe super(:node, :provision, 615) end |
Instance Method Details
#arguments ⇒ Object
31 32 33 |
# File 'lib/nucleon/action/node/provision.rb', line 31 def arguments [ :environment ] end |
#configure ⇒ Object
Settings
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/nucleon/action/node/provision.rb', line 17 def configure super do codes :provision_failure register_bool :build, false register_bool :dry_run, false register_bool :check_profiles, false register_str :environment end end |
#execute ⇒ Object
Operations
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/nucleon/action/node/provision.rb', line 38 def execute super do |node| ensure_node(node) do success = true settings.delete(:environment) if settings[:environment] == '' if settings.has_key?(:environment) CORL.create_fact(:corl_environment, settings[:environment]) end unless settings[:check_profiles] info('start', { :provider => node.plugin_provider, :name => node.plugin_name }) end if settings[:build] || settings.has_key?(:environment) || ! ( node.build_time && File.directory?(network.build_directory) ) info('build', { :provider => node.plugin_provider, :name => node.plugin_name }) success = node.build(settings) end if success provisioner_info = node.provisioner_info node.provisioners.each do |provider, collection| provider_info = provisioner_info[provider] profiles = provider_info[:profiles] collection.each do |name, provisioner| if supported_profiles = provisioner.supported_profiles(node, profiles) provisioner.profile_dependencies(node, supported_profiles).each do |profile| info('profile', { :provider => yellow(provider), :profile => green(profile.to_s) }) end if CORL.admin? && ! settings[:check_profiles] profile_success = provisioner.provision(node, supported_profiles, settings) success = false unless profile_success end end end end unless settings[:check_profiles] success('complete', { :provider => node.plugin_provider, :name => node.plugin_name, :time => Time.now.to_s }) if success end myself.status = code.provision_failure unless success end end end end |