corl 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -7
- data/.gitignore +51 -0
- data/Gemfile +6 -11
- data/Gemfile.lock +122 -147
- data/Rakefile +22 -21
- data/TODO.rdoc +12 -0
- data/VERSION +1 -1
- data/bin/corl +15 -21
- data/bootstrap/bootstrap.sh +50 -16
- data/bootstrap/lib/shell/os.sh +2 -2
- data/bootstrap/os/ubuntu/00_base.sh +11 -4
- data/bootstrap/os/ubuntu/01_git.sh +6 -3
- data/bootstrap/os/ubuntu/{02-editor.sh → 02_editor.sh} +8 -2
- data/bootstrap/os/ubuntu/05_ruby.sh +63 -15
- data/bootstrap/os/ubuntu/06_puppet.sh +9 -4
- data/bootstrap/os/ubuntu/09_nucleon.sh +25 -9
- data/bootstrap/os/ubuntu/10_corl.sh +24 -10
- data/corl.gemspec +27 -502
- data/lib/CORL/configuration/file.rb +112 -112
- data/lib/CORL/machine/rackspace.rb +18 -17
- data/lib/core/facade.rb +1 -1
- data/lib/core/plugin/agent.rb +141 -0
- data/lib/core/plugin/cloud_action.rb +67 -62
- data/lib/core/plugin/configuration.rb +71 -70
- data/lib/core/plugin/network.rb +163 -151
- data/lib/core/plugin/node.rb +457 -422
- data/lib/core/vagrant/commands/launcher.rb +13 -13
- data/lib/core/vagrant/provisioner/config.rb +1 -3
- data/lib/nucleon/action/node/bootstrap.rb +21 -16
- data/lib/nucleon/action/node/destroy.rb +13 -13
- data/lib/nucleon/action/node/seed.rb +62 -64
- data/lib/nucleon/action/node/status.rb +39 -32
- data/locales/en.yml +121 -116
- data/spec/spec_helper.rb +1 -4
- metadata +111 -641
- data/.document +0 -5
- data/lib/core/mod/fog_rackspace_server.rb +0 -29
- data/lib/core/vagrant/Vagrantfile +0 -10
- data/lib/nucleon/action/plugin/template/nucleon.action.erb +0 -56
- data/rdoc/site/0.4.29/CORL/Action/Authorize.html +0 -485
- data/rdoc/site/0.4.29/CORL/Action/Bootstrap.html +0 -546
- data/rdoc/site/0.4.29/CORL/Action/Build.html +0 -396
- data/rdoc/site/0.4.29/CORL/Action/Destroy.html +0 -515
- data/rdoc/site/0.4.29/CORL/Action/Exec.html +0 -472
- data/rdoc/site/0.4.29/CORL/Action/Facts.html +0 -398
- data/rdoc/site/0.4.29/CORL/Action/Image.html +0 -515
- data/rdoc/site/0.4.29/CORL/Action/Images.html +0 -514
- data/rdoc/site/0.4.29/CORL/Action/Ip.html +0 -395
- data/rdoc/site/0.4.29/CORL/Action/Keypair.html +0 -494
- data/rdoc/site/0.4.29/CORL/Action/Lookup.html +0 -474
- data/rdoc/site/0.4.29/CORL/Action/Machines.html +0 -509
- data/rdoc/site/0.4.29/CORL/Action/Provision.html +0 -456
- data/rdoc/site/0.4.29/CORL/Action/Reboot.html +0 -515
- data/rdoc/site/0.4.29/CORL/Action/Regions.html +0 -509
- data/rdoc/site/0.4.29/CORL/Action/Revoke.html +0 -483
- data/rdoc/site/0.4.29/CORL/Action/Seed.html +0 -544
- data/rdoc/site/0.4.29/CORL/Action/Spawn.html +0 -616
- data/rdoc/site/0.4.29/CORL/Action/Ssh.html +0 -526
- data/rdoc/site/0.4.29/CORL/Action/Start.html +0 -515
- data/rdoc/site/0.4.29/CORL/Action/Stop.html +0 -515
- data/rdoc/site/0.4.29/CORL/Action/Vagrantfile.html +0 -457
- data/rdoc/site/0.4.29/CORL/Action.html +0 -360
- data/rdoc/site/0.4.29/CORL/Configuration/File.html +0 -1128
- data/rdoc/site/0.4.29/CORL/Configuration.html +0 -339
- data/rdoc/site/0.4.29/CORL/Errors.html +0 -339
- data/rdoc/site/0.4.29/CORL/Event/Puppet.html +0 -673
- data/rdoc/site/0.4.29/CORL/Event.html +0 -339
- data/rdoc/site/0.4.29/CORL/Facade.html +0 -742
- data/rdoc/site/0.4.29/CORL/Machine/Aws.html +0 -733
- data/rdoc/site/0.4.29/CORL/Machine/Fog.html +0 -1269
- data/rdoc/site/0.4.29/CORL/Machine/Physical.html +0 -1039
- data/rdoc/site/0.4.29/CORL/Machine/Rackspace.html +0 -514
- data/rdoc/site/0.4.29/CORL/Machine/Vagrant.html +0 -1300
- data/rdoc/site/0.4.29/CORL/Machine.html +0 -343
- data/rdoc/site/0.4.29/CORL/Mixin/Action/Keypair.html +0 -572
- data/rdoc/site/0.4.29/CORL/Mixin/Action.html +0 -339
- data/rdoc/site/0.4.29/CORL/Mixin/Lookup.html +0 -954
- data/rdoc/site/0.4.29/CORL/Mixin/Machine/SSH.html +0 -643
- data/rdoc/site/0.4.29/CORL/Mixin/Machine.html +0 -339
- data/rdoc/site/0.4.29/CORL/Mixin/Macro/NetworkSettings.html +0 -464
- data/rdoc/site/0.4.29/CORL/Mixin/Macro.html +0 -339
- data/rdoc/site/0.4.29/CORL/Mixin.html +0 -342
- data/rdoc/site/0.4.29/CORL/Network/Default.html +0 -391
- data/rdoc/site/0.4.29/CORL/Network.html +0 -339
- data/rdoc/site/0.4.29/CORL/Node/Aws.html +0 -716
- data/rdoc/site/0.4.29/CORL/Node/Fog.html +0 -1192
- data/rdoc/site/0.4.29/CORL/Node/Local.html +0 -424
- data/rdoc/site/0.4.29/CORL/Node/Rackspace.html +0 -709
- data/rdoc/site/0.4.29/CORL/Node/Vagrant.html +0 -1451
- data/rdoc/site/0.4.29/CORL/Node.html +0 -343
- data/rdoc/site/0.4.29/CORL/Plugin/CloudAction.html +0 -810
- data/rdoc/site/0.4.29/CORL/Plugin.html +0 -339
- data/rdoc/site/0.4.29/CORL/Provisioner/Puppetnode.html +0 -1095
- data/rdoc/site/0.4.29/CORL/Provisioner.html +0 -339
- data/rdoc/site/0.4.29/CORL/Template/Environment.html +0 -528
- data/rdoc/site/0.4.29/CORL/Template.html +0 -339
- data/rdoc/site/0.4.29/CORL/Util/Puppet/Resource.html +0 -1038
- data/rdoc/site/0.4.29/CORL/Util/Puppet/ResourceGroup.html +0 -920
- data/rdoc/site/0.4.29/CORL/Util/Puppet.html +0 -1087
- data/rdoc/site/0.4.29/CORL/Util.html +0 -341
- data/rdoc/site/0.4.29/CORL/Vagrant/Config.html +0 -896
- data/rdoc/site/0.4.29/CORL/Vagrant.html +0 -418
- data/rdoc/site/0.4.29/CORL.html +0 -465
- data/rdoc/site/0.4.29/Facter/Util/Loader.html +0 -396
- data/rdoc/site/0.4.29/Facter/Util.html +0 -339
- data/rdoc/site/0.4.29/Facter.html +0 -339
- data/rdoc/site/0.4.29/Fog/Compute/AWS/Server.html +0 -423
- data/rdoc/site/0.4.29/Fog/Compute/AWS.html +0 -345
- data/rdoc/site/0.4.29/Fog/Compute/RackspaceV2/Server.html +0 -408
- data/rdoc/site/0.4.29/Fog/Compute/RackspaceV2.html +0 -345
- data/rdoc/site/0.4.29/Fog/Compute.html +0 -340
- data/rdoc/site/0.4.29/Fog.html +0 -340
- data/rdoc/site/0.4.29/Hiera/Backend.html +0 -422
- data/rdoc/site/0.4.29/Hiera/Corl_logger.html +0 -449
- data/rdoc/site/0.4.29/Hiera.html +0 -346
- data/rdoc/site/0.4.29/Nucleon/Config.html +0 -357
- data/rdoc/site/0.4.29/Nucleon/Plugin/Base.html +0 -345
- data/rdoc/site/0.4.29/Nucleon/Plugin/Configuration.html +0 -1213
- data/rdoc/site/0.4.29/Nucleon/Plugin/Machine.html +0 -1279
- data/rdoc/site/0.4.29/Nucleon/Plugin/Network.html +0 -1425
- data/rdoc/site/0.4.29/Nucleon/Plugin/Node.html +0 -3715
- data/rdoc/site/0.4.29/Nucleon/Plugin/Provisioner.html +0 -1297
- data/rdoc/site/0.4.29/Nucleon/Plugin.html +0 -344
- data/rdoc/site/0.4.29/Nucleon.html +0 -344
- data/rdoc/site/0.4.29/Object.html +0 -358
- data/rdoc/site/0.4.29/Puppet/DataBinding/Corl.html +0 -345
- data/rdoc/site/0.4.29/Puppet/DataBinding.html +0 -338
- data/rdoc/site/0.4.29/Puppet/Indirector/Corl.html +0 -454
- data/rdoc/site/0.4.29/Puppet/Indirector.html +0 -338
- data/rdoc/site/0.4.29/Puppet/Parser/Functions.html +0 -480
- data/rdoc/site/0.4.29/Puppet/Parser.html +0 -338
- data/rdoc/site/0.4.29/Puppet.html +0 -338
- data/rdoc/site/0.4.29/README_rdoc.html +0 -340
- data/rdoc/site/0.4.29/Vagrant/Config/Loader.html +0 -399
- data/rdoc/site/0.4.29/Vagrant/Config.html +0 -339
- data/rdoc/site/0.4.29/Vagrant/Vagrantfile.html +0 -392
- data/rdoc/site/0.4.29/Vagrant.html +0 -346
- data/rdoc/site/0.4.29/VagrantPlugins/CORL/Action/DeleteCache.html +0 -396
- data/rdoc/site/0.4.29/VagrantPlugins/CORL/Action/InitKeys.html +0 -408
- data/rdoc/site/0.4.29/VagrantPlugins/CORL/Action/LinkNetwork.html +0 -406
- data/rdoc/site/0.4.29/VagrantPlugins/CORL/Action.html +0 -341
- data/rdoc/site/0.4.29/VagrantPlugins/CORL/BaseAction.html +0 -491
- data/rdoc/site/0.4.29/VagrantPlugins/CORL/Command/Launcher.html +0 -533
- data/rdoc/site/0.4.29/VagrantPlugins/CORL/Command.html +0 -339
- data/rdoc/site/0.4.29/VagrantPlugins/CORL/Config/CORL.html +0 -732
- data/rdoc/site/0.4.29/VagrantPlugins/CORL/Config.html +0 -339
- data/rdoc/site/0.4.29/VagrantPlugins/CORL/Plugin.html +0 -345
- data/rdoc/site/0.4.29/VagrantPlugins/CORL/Provisioner/CORL.html +0 -536
- data/rdoc/site/0.4.29/VagrantPlugins/CORL/Provisioner.html +0 -339
- data/rdoc/site/0.4.29/VagrantPlugins/CORL.html +0 -346
- data/rdoc/site/0.4.29/VagrantPlugins.html +0 -346
- data/rdoc/site/0.4.29/created.rid +0 -96
- data/rdoc/site/0.4.29/images/add.png +0 -0
- data/rdoc/site/0.4.29/images/brick.png +0 -0
- data/rdoc/site/0.4.29/images/brick_link.png +0 -0
- data/rdoc/site/0.4.29/images/bug.png +0 -0
- data/rdoc/site/0.4.29/images/bullet_black.png +0 -0
- data/rdoc/site/0.4.29/images/bullet_toggle_minus.png +0 -0
- data/rdoc/site/0.4.29/images/bullet_toggle_plus.png +0 -0
- data/rdoc/site/0.4.29/images/date.png +0 -0
- data/rdoc/site/0.4.29/images/delete.png +0 -0
- data/rdoc/site/0.4.29/images/find.png +0 -0
- data/rdoc/site/0.4.29/images/loadingAnimation.gif +0 -0
- data/rdoc/site/0.4.29/images/macFFBgHack.png +0 -0
- data/rdoc/site/0.4.29/images/package.png +0 -0
- data/rdoc/site/0.4.29/images/page_green.png +0 -0
- data/rdoc/site/0.4.29/images/page_white_text.png +0 -0
- data/rdoc/site/0.4.29/images/page_white_width.png +0 -0
- data/rdoc/site/0.4.29/images/plugin.png +0 -0
- data/rdoc/site/0.4.29/images/ruby.png +0 -0
- data/rdoc/site/0.4.29/images/tag_blue.png +0 -0
- data/rdoc/site/0.4.29/images/tag_green.png +0 -0
- data/rdoc/site/0.4.29/images/transparent.png +0 -0
- data/rdoc/site/0.4.29/images/wrench.png +0 -0
- data/rdoc/site/0.4.29/images/wrench_orange.png +0 -0
- data/rdoc/site/0.4.29/images/zoom.png +0 -0
- data/rdoc/site/0.4.29/index.html +0 -339
- data/rdoc/site/0.4.29/js/darkfish.js +0 -155
- data/rdoc/site/0.4.29/js/jquery.js +0 -18
- data/rdoc/site/0.4.29/js/navigation.js +0 -142
- data/rdoc/site/0.4.29/js/search.js +0 -94
- data/rdoc/site/0.4.29/js/search_index.js +0 -1
- data/rdoc/site/0.4.29/js/searcher.js +0 -228
- data/rdoc/site/0.4.29/rdoc.css +0 -543
- data/rdoc/site/0.4.29/table_of_contents.html +0 -1561
- data/rdoc/site/0.5.0/CORL/Build.html +0 -757
- data/rdoc/site/0.5.0/CORL/Builder/Identity.html +0 -569
- data/rdoc/site/0.5.0/CORL/Builder/Package.html +0 -576
- data/rdoc/site/0.5.0/CORL/Builder.html +0 -360
- data/rdoc/site/0.5.0/CORL/Configuration/File.html +0 -1148
- data/rdoc/site/0.5.0/CORL/Configuration.html +0 -359
- data/rdoc/site/0.5.0/CORL/Errors.html +0 -359
- data/rdoc/site/0.5.0/CORL/Facade.html +0 -899
- data/rdoc/site/0.5.0/CORL/Machine/AWS.html +0 -753
- data/rdoc/site/0.5.0/CORL/Machine/Fog.html +0 -1289
- data/rdoc/site/0.5.0/CORL/Machine/Physical.html +0 -1059
- data/rdoc/site/0.5.0/CORL/Machine/Rackspace.html +0 -534
- data/rdoc/site/0.5.0/CORL/Machine/Vagrant.html +0 -1320
- data/rdoc/site/0.5.0/CORL/Machine.html +0 -363
- data/rdoc/site/0.5.0/CORL/Mixin/Action/Keypair.html +0 -592
- data/rdoc/site/0.5.0/CORL/Mixin/Action.html +0 -359
- data/rdoc/site/0.5.0/CORL/Mixin/Builder/Global.html +0 -604
- data/rdoc/site/0.5.0/CORL/Mixin/Builder/Instance.html +0 -696
- data/rdoc/site/0.5.0/CORL/Mixin/Builder.html +0 -359
- data/rdoc/site/0.5.0/CORL/Mixin/Lookup.html +0 -1139
- data/rdoc/site/0.5.0/CORL/Mixin/Machine/SSH.html +0 -675
- data/rdoc/site/0.5.0/CORL/Mixin/Machine.html +0 -359
- data/rdoc/site/0.5.0/CORL/Mixin/Macro/NetworkSettings.html +0 -484
- data/rdoc/site/0.5.0/CORL/Mixin/Macro.html +0 -359
- data/rdoc/site/0.5.0/CORL/Mixin.html +0 -363
- data/rdoc/site/0.5.0/CORL/Network/CORL.html +0 -411
- data/rdoc/site/0.5.0/CORL/Network.html +0 -359
- data/rdoc/site/0.5.0/CORL/Node/AWS.html +0 -736
- data/rdoc/site/0.5.0/CORL/Node/Fog.html +0 -1212
- data/rdoc/site/0.5.0/CORL/Node/Local.html +0 -444
- data/rdoc/site/0.5.0/CORL/Node/Rackspace.html +0 -729
- data/rdoc/site/0.5.0/CORL/Node/Vagrant.html +0 -1476
- data/rdoc/site/0.5.0/CORL/Node.html +0 -363
- data/rdoc/site/0.5.0/CORL/Plugin/Builder.html +0 -500
- data/rdoc/site/0.5.0/CORL/Plugin/Configuration.html +0 -1271
- data/rdoc/site/0.5.0/CORL/Plugin/Machine.html +0 -1299
- data/rdoc/site/0.5.0/CORL/Plugin/Network.html +0 -1580
- data/rdoc/site/0.5.0/CORL/Plugin/Node.html +0 -4041
- data/rdoc/site/0.5.0/CORL/Plugin/Provisioner.html +0 -1115
- data/rdoc/site/0.5.0/CORL/Plugin.html +0 -649
- data/rdoc/site/0.5.0/CORL/Provisioner/Puppetnode.html +0 -1177
- data/rdoc/site/0.5.0/CORL/Provisioner.html +0 -359
- data/rdoc/site/0.5.0/CORL/Util/Puppet/Resource.html +0 -1058
- data/rdoc/site/0.5.0/CORL/Util/Puppet/ResourceGroup.html +0 -940
- data/rdoc/site/0.5.0/CORL/Util/Puppet.html +0 -1107
- data/rdoc/site/0.5.0/CORL/Util.html +0 -361
- data/rdoc/site/0.5.0/CORL/Vagrant/Config.html +0 -943
- data/rdoc/site/0.5.0/CORL/Vagrant.html +0 -438
- data/rdoc/site/0.5.0/CORL.html +0 -471
- data/rdoc/site/0.5.0/Fog/Compute/AWS/Server.html +0 -443
- data/rdoc/site/0.5.0/Fog/Compute/AWS.html +0 -365
- data/rdoc/site/0.5.0/Fog/Compute/RackspaceV2/Server.html +0 -428
- data/rdoc/site/0.5.0/Fog/Compute/RackspaceV2.html +0 -365
- data/rdoc/site/0.5.0/Fog/Compute.html +0 -360
- data/rdoc/site/0.5.0/Fog.html +0 -360
- data/rdoc/site/0.5.0/Hiera/Backend.html +0 -442
- data/rdoc/site/0.5.0/Hiera/Corl_logger.html +0 -469
- data/rdoc/site/0.5.0/Hiera.html +0 -366
- data/rdoc/site/0.5.0/Nucleon/Action/Cloud/Create.html +0 -538
- data/rdoc/site/0.5.0/Nucleon/Action/Cloud/Hiera.html +0 -566
- data/rdoc/site/0.5.0/Nucleon/Action/Cloud/Images.html +0 -572
- data/rdoc/site/0.5.0/Nucleon/Action/Cloud/Inspect.html +0 -524
- data/rdoc/site/0.5.0/Nucleon/Action/Cloud/Machines.html +0 -567
- data/rdoc/site/0.5.0/Nucleon/Action/Cloud/Regions.html +0 -567
- data/rdoc/site/0.5.0/Nucleon/Action/Cloud/Vagrantfile.html +0 -515
- data/rdoc/site/0.5.0/Nucleon/Action/Cloud.html +0 -365
- data/rdoc/site/0.5.0/Nucleon/Action/Node/Authorize.html +0 -543
- data/rdoc/site/0.5.0/Nucleon/Action/Node/Bootstrap.html +0 -604
- data/rdoc/site/0.5.0/Nucleon/Action/Node/Build.html +0 -526
- data/rdoc/site/0.5.0/Nucleon/Action/Node/Destroy.html +0 -573
- data/rdoc/site/0.5.0/Nucleon/Action/Node/Exec.html +0 -530
- data/rdoc/site/0.5.0/Nucleon/Action/Node/Facts.html +0 -456
- data/rdoc/site/0.5.0/Nucleon/Action/Node/IP.html +0 -453
- data/rdoc/site/0.5.0/Nucleon/Action/Node/Image.html +0 -573
- data/rdoc/site/0.5.0/Nucleon/Action/Node/Keypair.html +0 -572
- data/rdoc/site/0.5.0/Nucleon/Action/Node/Lookup.html +0 -532
- data/rdoc/site/0.5.0/Nucleon/Action/Node/Provision.html +0 -553
- data/rdoc/site/0.5.0/Nucleon/Action/Node/Reboot.html +0 -573
- data/rdoc/site/0.5.0/Nucleon/Action/Node/Revoke.html +0 -541
- data/rdoc/site/0.5.0/Nucleon/Action/Node/SSH.html +0 -583
- data/rdoc/site/0.5.0/Nucleon/Action/Node/Seed.html +0 -602
- data/rdoc/site/0.5.0/Nucleon/Action/Node/Spawn.html +0 -675
- data/rdoc/site/0.5.0/Nucleon/Action/Node/Start.html +0 -573
- data/rdoc/site/0.5.0/Nucleon/Action/Node/Stop.html +0 -573
- data/rdoc/site/0.5.0/Nucleon/Action/Node.html +0 -376
- data/rdoc/site/0.5.0/Nucleon/Action.html +0 -383
- data/rdoc/site/0.5.0/Nucleon/Config.html +0 -377
- data/rdoc/site/0.5.0/Nucleon/Event/Puppet.html +0 -693
- data/rdoc/site/0.5.0/Nucleon/Event.html +0 -359
- data/rdoc/site/0.5.0/Nucleon/Plugin/Base.html +0 -365
- data/rdoc/site/0.5.0/Nucleon/Plugin/CloudAction.html +0 -838
- data/rdoc/site/0.5.0/Nucleon/Plugin.html +0 -360
- data/rdoc/site/0.5.0/Nucleon/Template/Environment.html +0 -548
- data/rdoc/site/0.5.0/Nucleon/Template.html +0 -359
- data/rdoc/site/0.5.0/Nucleon.html +0 -387
- data/rdoc/site/0.5.0/Object.html +0 -378
- data/rdoc/site/0.5.0/Puppet/DataBinding/Corl.html +0 -365
- data/rdoc/site/0.5.0/Puppet/DataBinding.html +0 -358
- data/rdoc/site/0.5.0/Puppet/Indirector/Corl.html +0 -477
- data/rdoc/site/0.5.0/Puppet/Indirector.html +0 -358
- data/rdoc/site/0.5.0/Puppet/Parser/Functions.html +0 -500
- data/rdoc/site/0.5.0/Puppet/Parser.html +0 -358
- data/rdoc/site/0.5.0/Puppet.html +0 -358
- data/rdoc/site/0.5.0/README_rdoc.html +0 -360
- data/rdoc/site/0.5.0/Vagrant/Config/Loader.html +0 -419
- data/rdoc/site/0.5.0/Vagrant/Config.html +0 -359
- data/rdoc/site/0.5.0/Vagrant/Vagrantfile.html +0 -412
- data/rdoc/site/0.5.0/Vagrant.html +0 -366
- data/rdoc/site/0.5.0/VagrantPlugins/CORL/Action/DeleteCache.html +0 -422
- data/rdoc/site/0.5.0/VagrantPlugins/CORL/Action/InitKeys.html +0 -428
- data/rdoc/site/0.5.0/VagrantPlugins/CORL/Action/LinkNetwork.html +0 -426
- data/rdoc/site/0.5.0/VagrantPlugins/CORL/Action.html +0 -361
- data/rdoc/site/0.5.0/VagrantPlugins/CORL/BaseAction.html +0 -511
- data/rdoc/site/0.5.0/VagrantPlugins/CORL/Command/Launcher.html +0 -553
- data/rdoc/site/0.5.0/VagrantPlugins/CORL/Command.html +0 -359
- data/rdoc/site/0.5.0/VagrantPlugins/CORL/Config/CORL.html +0 -752
- data/rdoc/site/0.5.0/VagrantPlugins/CORL/Config.html +0 -359
- data/rdoc/site/0.5.0/VagrantPlugins/CORL/Plugin.html +0 -365
- data/rdoc/site/0.5.0/VagrantPlugins/CORL/Provisioner/CORL.html +0 -556
- data/rdoc/site/0.5.0/VagrantPlugins/CORL/Provisioner.html +0 -359
- data/rdoc/site/0.5.0/VagrantPlugins/CORL.html +0 -366
- data/rdoc/site/0.5.0/VagrantPlugins.html +0 -366
- data/rdoc/site/0.5.0/created.rid +0 -103
- data/rdoc/site/0.5.0/images/add.png +0 -0
- data/rdoc/site/0.5.0/images/brick.png +0 -0
- data/rdoc/site/0.5.0/images/brick_link.png +0 -0
- data/rdoc/site/0.5.0/images/bug.png +0 -0
- data/rdoc/site/0.5.0/images/bullet_black.png +0 -0
- data/rdoc/site/0.5.0/images/bullet_toggle_minus.png +0 -0
- data/rdoc/site/0.5.0/images/bullet_toggle_plus.png +0 -0
- data/rdoc/site/0.5.0/images/date.png +0 -0
- data/rdoc/site/0.5.0/images/delete.png +0 -0
- data/rdoc/site/0.5.0/images/find.png +0 -0
- data/rdoc/site/0.5.0/images/loadingAnimation.gif +0 -0
- data/rdoc/site/0.5.0/images/macFFBgHack.png +0 -0
- data/rdoc/site/0.5.0/images/package.png +0 -0
- data/rdoc/site/0.5.0/images/page_green.png +0 -0
- data/rdoc/site/0.5.0/images/page_white_text.png +0 -0
- data/rdoc/site/0.5.0/images/page_white_width.png +0 -0
- data/rdoc/site/0.5.0/images/plugin.png +0 -0
- data/rdoc/site/0.5.0/images/ruby.png +0 -0
- data/rdoc/site/0.5.0/images/tag_blue.png +0 -0
- data/rdoc/site/0.5.0/images/tag_green.png +0 -0
- data/rdoc/site/0.5.0/images/transparent.png +0 -0
- data/rdoc/site/0.5.0/images/wrench.png +0 -0
- data/rdoc/site/0.5.0/images/wrench_orange.png +0 -0
- data/rdoc/site/0.5.0/images/zoom.png +0 -0
- data/rdoc/site/0.5.0/index.html +0 -359
- data/rdoc/site/0.5.0/js/darkfish.js +0 -155
- data/rdoc/site/0.5.0/js/jquery.js +0 -18
- data/rdoc/site/0.5.0/js/navigation.js +0 -142
- data/rdoc/site/0.5.0/js/search.js +0 -94
- data/rdoc/site/0.5.0/js/search_index.js +0 -1
- data/rdoc/site/0.5.0/js/searcher.js +0 -228
- data/rdoc/site/0.5.0/rdoc.css +0 -543
- data/rdoc/site/0.5.0/table_of_contents.html +0 -1797
- data/rdoc/site/0.5.1/CORL/Build.html +0 -781
- data/rdoc/site/0.5.1/CORL/Builder/Identity.html +0 -596
- data/rdoc/site/0.5.1/CORL/Builder/Package.html +0 -600
- data/rdoc/site/0.5.1/CORL/Builder.html +0 -384
- data/rdoc/site/0.5.1/CORL/Configuration/File.html +0 -1186
- data/rdoc/site/0.5.1/CORL/Configuration.html +0 -383
- data/rdoc/site/0.5.1/CORL/Errors.html +0 -383
- data/rdoc/site/0.5.1/CORL/Facade.html +0 -927
- data/rdoc/site/0.5.1/CORL/Machine/AWS.html +0 -777
- data/rdoc/site/0.5.1/CORL/Machine/Fog.html +0 -1313
- data/rdoc/site/0.5.1/CORL/Machine/Physical.html +0 -1083
- data/rdoc/site/0.5.1/CORL/Machine/Rackspace.html +0 -558
- data/rdoc/site/0.5.1/CORL/Machine/Vagrant.html +0 -1344
- data/rdoc/site/0.5.1/CORL/Machine.html +0 -387
- data/rdoc/site/0.5.1/CORL/Mixin/Action/Keypair.html +0 -616
- data/rdoc/site/0.5.1/CORL/Mixin/Action/Registration.html +0 -469
- data/rdoc/site/0.5.1/CORL/Mixin/Action.html +0 -384
- data/rdoc/site/0.5.1/CORL/Mixin/Builder/Global.html +0 -628
- data/rdoc/site/0.5.1/CORL/Mixin/Builder/Instance.html +0 -720
- data/rdoc/site/0.5.1/CORL/Mixin/Builder.html +0 -383
- data/rdoc/site/0.5.1/CORL/Mixin/Lookup.html +0 -1315
- data/rdoc/site/0.5.1/CORL/Mixin/Machine/SSH.html +0 -699
- data/rdoc/site/0.5.1/CORL/Mixin/Machine.html +0 -383
- data/rdoc/site/0.5.1/CORL/Mixin/Macro/NetworkSettings.html +0 -508
- data/rdoc/site/0.5.1/CORL/Mixin/Macro.html +0 -383
- data/rdoc/site/0.5.1/CORL/Mixin.html +0 -388
- data/rdoc/site/0.5.1/CORL/Network/CORL.html +0 -435
- data/rdoc/site/0.5.1/CORL/Network.html +0 -383
- data/rdoc/site/0.5.1/CORL/Node/AWS.html +0 -760
- data/rdoc/site/0.5.1/CORL/Node/Fog.html +0 -1268
- data/rdoc/site/0.5.1/CORL/Node/Local.html +0 -468
- data/rdoc/site/0.5.1/CORL/Node/Rackspace.html +0 -753
- data/rdoc/site/0.5.1/CORL/Node/Vagrant.html +0 -1497
- data/rdoc/site/0.5.1/CORL/Node.html +0 -387
- data/rdoc/site/0.5.1/CORL/Plugin/Builder.html +0 -524
- data/rdoc/site/0.5.1/CORL/Plugin/Configuration.html +0 -1294
- data/rdoc/site/0.5.1/CORL/Plugin/Machine.html +0 -1323
- data/rdoc/site/0.5.1/CORL/Plugin/Network.html +0 -1766
- data/rdoc/site/0.5.1/CORL/Plugin/Node.html +0 -4263
- data/rdoc/site/0.5.1/CORL/Plugin/Provisioner.html +0 -1139
- data/rdoc/site/0.5.1/CORL/Plugin.html +0 -673
- data/rdoc/site/0.5.1/CORL/Provisioner/Puppetnode.html +0 -1201
- data/rdoc/site/0.5.1/CORL/Provisioner.html +0 -383
- data/rdoc/site/0.5.1/CORL/Util/Puppet/Resource.html +0 -1082
- data/rdoc/site/0.5.1/CORL/Util/Puppet/ResourceGroup.html +0 -964
- data/rdoc/site/0.5.1/CORL/Util/Puppet.html +0 -1131
- data/rdoc/site/0.5.1/CORL/Util.html +0 -385
- data/rdoc/site/0.5.1/CORL/Vagrant/Config.html +0 -967
- data/rdoc/site/0.5.1/CORL/Vagrant.html +0 -462
- data/rdoc/site/0.5.1/CORL.html +0 -496
- data/rdoc/site/0.5.1/Fog/Compute/AWS/Server.html +0 -467
- data/rdoc/site/0.5.1/Fog/Compute/AWS.html +0 -389
- data/rdoc/site/0.5.1/Fog/Compute/RackspaceV2/Server.html +0 -452
- data/rdoc/site/0.5.1/Fog/Compute/RackspaceV2.html +0 -389
- data/rdoc/site/0.5.1/Fog/Compute.html +0 -384
- data/rdoc/site/0.5.1/Fog.html +0 -384
- data/rdoc/site/0.5.1/Hiera/Backend.html +0 -466
- data/rdoc/site/0.5.1/Hiera/Corl_logger.html +0 -493
- data/rdoc/site/0.5.1/Hiera.html +0 -390
- data/rdoc/site/0.5.1/Nucleon/Action/Cloud/Config.html +0 -978
- data/rdoc/site/0.5.1/Nucleon/Action/Cloud/Create.html +0 -562
- data/rdoc/site/0.5.1/Nucleon/Action/Cloud/Images.html +0 -596
- data/rdoc/site/0.5.1/Nucleon/Action/Cloud/Inspect.html +0 -567
- data/rdoc/site/0.5.1/Nucleon/Action/Cloud/Machines.html +0 -591
- data/rdoc/site/0.5.1/Nucleon/Action/Cloud/Regions.html +0 -591
- data/rdoc/site/0.5.1/Nucleon/Action/Cloud/Settings.html +0 -878
- data/rdoc/site/0.5.1/Nucleon/Action/Cloud/Vagrantfile.html +0 -539
- data/rdoc/site/0.5.1/Nucleon/Action/Cloud.html +0 -390
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Authorize.html +0 -567
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Bootstrap.html +0 -628
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Build.html +0 -550
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Cache.html +0 -773
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Destroy.html +0 -597
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Exec.html +0 -554
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Fact.html +0 -733
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Facts.html +0 -505
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Group.html +0 -729
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Groups.html +0 -505
- data/rdoc/site/0.5.1/Nucleon/Action/Node/IP.html +0 -477
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Identity.html +0 -614
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Image.html +0 -597
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Keypair.html +0 -596
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Lookup.html +0 -579
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Provision.html +0 -577
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Reboot.html +0 -597
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Revoke.html +0 -565
- data/rdoc/site/0.5.1/Nucleon/Action/Node/SSH.html +0 -607
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Seed.html +0 -626
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Spawn.html +0 -699
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Start.html +0 -597
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Status.html +0 -615
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Stop.html +0 -597
- data/rdoc/site/0.5.1/Nucleon/Action/Node.html +0 -406
- data/rdoc/site/0.5.1/Nucleon/Action/Plugin/Create.html +0 -736
- data/rdoc/site/0.5.1/Nucleon/Action/Plugin/List.html +0 -570
- data/rdoc/site/0.5.1/Nucleon/Action/Plugin.html +0 -384
- data/rdoc/site/0.5.1/Nucleon/Action/Plugins.html +0 -435
- data/rdoc/site/0.5.1/Nucleon/Action.html +0 -417
- data/rdoc/site/0.5.1/Nucleon/Config.html +0 -401
- data/rdoc/site/0.5.1/Nucleon/Event/Puppet.html +0 -717
- data/rdoc/site/0.5.1/Nucleon/Event.html +0 -383
- data/rdoc/site/0.5.1/Nucleon/Plugin/Base.html +0 -389
- data/rdoc/site/0.5.1/Nucleon/Plugin/CloudAction.html +0 -894
- data/rdoc/site/0.5.1/Nucleon/Plugin.html +0 -384
- data/rdoc/site/0.5.1/Nucleon/Template/Environment.html +0 -572
- data/rdoc/site/0.5.1/Nucleon/Template.html +0 -383
- data/rdoc/site/0.5.1/Nucleon.html +0 -421
- data/rdoc/site/0.5.1/Object.html +0 -402
- data/rdoc/site/0.5.1/Puppet/DataBinding/Corl.html +0 -389
- data/rdoc/site/0.5.1/Puppet/DataBinding.html +0 -382
- data/rdoc/site/0.5.1/Puppet/Indirector/Corl.html +0 -501
- data/rdoc/site/0.5.1/Puppet/Indirector.html +0 -382
- data/rdoc/site/0.5.1/Puppet/Parser/Functions.html +0 -524
- data/rdoc/site/0.5.1/Puppet/Parser.html +0 -382
- data/rdoc/site/0.5.1/Puppet.html +0 -382
- data/rdoc/site/0.5.1/README_rdoc.html +0 -384
- data/rdoc/site/0.5.1/Vagrant/Config/Loader.html +0 -443
- data/rdoc/site/0.5.1/Vagrant/Config.html +0 -383
- data/rdoc/site/0.5.1/Vagrant/Vagrantfile.html +0 -436
- data/rdoc/site/0.5.1/Vagrant.html +0 -390
- data/rdoc/site/0.5.1/VagrantPlugins/CORL/Action/DeleteCache.html +0 -446
- data/rdoc/site/0.5.1/VagrantPlugins/CORL/Action/InitKeys.html +0 -452
- data/rdoc/site/0.5.1/VagrantPlugins/CORL/Action/LinkNetwork.html +0 -450
- data/rdoc/site/0.5.1/VagrantPlugins/CORL/Action.html +0 -385
- data/rdoc/site/0.5.1/VagrantPlugins/CORL/BaseAction.html +0 -535
- data/rdoc/site/0.5.1/VagrantPlugins/CORL/Command/Launcher.html +0 -577
- data/rdoc/site/0.5.1/VagrantPlugins/CORL/Command.html +0 -383
- data/rdoc/site/0.5.1/VagrantPlugins/CORL/Config/CORL.html +0 -776
- data/rdoc/site/0.5.1/VagrantPlugins/CORL/Config.html +0 -383
- data/rdoc/site/0.5.1/VagrantPlugins/CORL/Plugin.html +0 -389
- data/rdoc/site/0.5.1/VagrantPlugins/CORL/Provisioner/CORL.html +0 -580
- data/rdoc/site/0.5.1/VagrantPlugins/CORL/Provisioner.html +0 -383
- data/rdoc/site/0.5.1/VagrantPlugins/CORL.html +0 -390
- data/rdoc/site/0.5.1/VagrantPlugins.html +0 -390
- data/rdoc/site/0.5.1/created.rid +0 -114
- data/rdoc/site/0.5.1/images/add.png +0 -0
- data/rdoc/site/0.5.1/images/brick.png +0 -0
- data/rdoc/site/0.5.1/images/brick_link.png +0 -0
- data/rdoc/site/0.5.1/images/bug.png +0 -0
- data/rdoc/site/0.5.1/images/bullet_black.png +0 -0
- data/rdoc/site/0.5.1/images/bullet_toggle_minus.png +0 -0
- data/rdoc/site/0.5.1/images/bullet_toggle_plus.png +0 -0
- data/rdoc/site/0.5.1/images/date.png +0 -0
- data/rdoc/site/0.5.1/images/delete.png +0 -0
- data/rdoc/site/0.5.1/images/find.png +0 -0
- data/rdoc/site/0.5.1/images/loadingAnimation.gif +0 -0
- data/rdoc/site/0.5.1/images/macFFBgHack.png +0 -0
- data/rdoc/site/0.5.1/images/package.png +0 -0
- data/rdoc/site/0.5.1/images/page_green.png +0 -0
- data/rdoc/site/0.5.1/images/page_white_text.png +0 -0
- data/rdoc/site/0.5.1/images/page_white_width.png +0 -0
- data/rdoc/site/0.5.1/images/plugin.png +0 -0
- data/rdoc/site/0.5.1/images/ruby.png +0 -0
- data/rdoc/site/0.5.1/images/tag_blue.png +0 -0
- data/rdoc/site/0.5.1/images/tag_green.png +0 -0
- data/rdoc/site/0.5.1/images/transparent.png +0 -0
- data/rdoc/site/0.5.1/images/wrench.png +0 -0
- data/rdoc/site/0.5.1/images/wrench_orange.png +0 -0
- data/rdoc/site/0.5.1/images/zoom.png +0 -0
- data/rdoc/site/0.5.1/index.html +0 -383
- data/rdoc/site/0.5.1/js/darkfish.js +0 -155
- data/rdoc/site/0.5.1/js/jquery.js +0 -18
- data/rdoc/site/0.5.1/js/navigation.js +0 -142
- data/rdoc/site/0.5.1/js/search.js +0 -94
- data/rdoc/site/0.5.1/js/search_index.js +0 -1
- data/rdoc/site/0.5.1/js/searcher.js +0 -228
- data/rdoc/site/0.5.1/rdoc.css +0 -543
- data/rdoc/site/0.5.1/table_of_contents.html +0 -2005
- data/spec/corl_mock_input.rb +0 -29
- data/spec/corl_test_kernel.rb +0 -22
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
|
|
2
|
+
nucleon_require(File.dirname(__FILE__), :cloud_action)
|
|
3
|
+
|
|
4
|
+
#---
|
|
5
|
+
|
|
6
|
+
module Nucleon
|
|
7
|
+
module Plugin
|
|
8
|
+
class Agent < Nucleon.plugin_class(:nucleon, :cloud_action)
|
|
9
|
+
|
|
10
|
+
#-----------------------------------------------------------------------------
|
|
11
|
+
# Property accessor / modifiers
|
|
12
|
+
|
|
13
|
+
def configure
|
|
14
|
+
super do
|
|
15
|
+
yield if block_given?
|
|
16
|
+
agent_config
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
#---
|
|
21
|
+
|
|
22
|
+
def help
|
|
23
|
+
# TODO: Localization
|
|
24
|
+
'AGENT ' + super
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
#-----------------------------------------------------------------------------
|
|
28
|
+
# Settings
|
|
29
|
+
|
|
30
|
+
def pid
|
|
31
|
+
settings[:pid]
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
#---
|
|
35
|
+
|
|
36
|
+
def agent_config
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
#-----------------------------------------------------------------------------
|
|
40
|
+
# Operations
|
|
41
|
+
|
|
42
|
+
def execute(use_network = true, &code)
|
|
43
|
+
super do |node|
|
|
44
|
+
ensure_network do
|
|
45
|
+
daemonize(node)
|
|
46
|
+
yield node
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
#---
|
|
52
|
+
|
|
53
|
+
def daemonize(node)
|
|
54
|
+
# Mostly derived from rack gem implementation
|
|
55
|
+
#
|
|
56
|
+
# https://github.com/rack/rack/blob/master/lib/rack/server.rb
|
|
57
|
+
# http://www.jstorimer.com/blogs/workingwithcode/7766093-daemon-processes-in-ruby
|
|
58
|
+
#
|
|
59
|
+
if RUBY_VERSION < "1.9"
|
|
60
|
+
exit if fork
|
|
61
|
+
Process.setsid
|
|
62
|
+
safe_exit if fork
|
|
63
|
+
|
|
64
|
+
Dir.chdir network.directory
|
|
65
|
+
|
|
66
|
+
STDIN.reopen "/dev/null"
|
|
67
|
+
STDOUT.reopen "/dev/null", "a"
|
|
68
|
+
STDERR.reopen "/dev/null", "a"
|
|
69
|
+
else
|
|
70
|
+
Process.daemon
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
#---
|
|
74
|
+
|
|
75
|
+
save_process(node)
|
|
76
|
+
|
|
77
|
+
at_exit do
|
|
78
|
+
shutdown_process(node)
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
trap(:INT) do
|
|
82
|
+
safe_exit
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
protected :daemonize
|
|
86
|
+
|
|
87
|
+
#-----------------------------------------------------------------------------
|
|
88
|
+
# Utilities
|
|
89
|
+
|
|
90
|
+
def process_status(node)
|
|
91
|
+
agent_settings = node.agent(plugin_provider)
|
|
92
|
+
|
|
93
|
+
return :not_running unless agent_settings && agent_settings.has_key?(:pid)
|
|
94
|
+
return :dead if agent_settings[:pid] == 0
|
|
95
|
+
|
|
96
|
+
Process.kill(0, agent_settings[:pid])
|
|
97
|
+
:running
|
|
98
|
+
|
|
99
|
+
rescue Errno::ESRCH
|
|
100
|
+
:dead
|
|
101
|
+
rescue Errno::EPERM
|
|
102
|
+
:not_owned
|
|
103
|
+
end
|
|
104
|
+
protected :process_status
|
|
105
|
+
|
|
106
|
+
#---
|
|
107
|
+
|
|
108
|
+
def save_process(node)
|
|
109
|
+
settings[:pid] = Process.pid
|
|
110
|
+
|
|
111
|
+
node.add_agent(plugin_provider, settings)
|
|
112
|
+
node.save({
|
|
113
|
+
:message => "Agent #{plugin_provider} starting up on #{node.plugin_name}",
|
|
114
|
+
:remote => extension_set(:write_process_remote, :edit),
|
|
115
|
+
:push => true
|
|
116
|
+
})
|
|
117
|
+
end
|
|
118
|
+
protected :save_process
|
|
119
|
+
|
|
120
|
+
#---
|
|
121
|
+
|
|
122
|
+
def shutdown_process(node)
|
|
123
|
+
node.remove_agent(plugin_provider)
|
|
124
|
+
node.save({
|
|
125
|
+
:message => "Agent #{plugin_provider} shutting down on #{node.plugin_name}",
|
|
126
|
+
:remote => extension_set(:shutdown_handler_remote, :edit),
|
|
127
|
+
:push => true
|
|
128
|
+
})
|
|
129
|
+
end
|
|
130
|
+
protected :shutdown_process
|
|
131
|
+
|
|
132
|
+
#---
|
|
133
|
+
|
|
134
|
+
def safe_exit
|
|
135
|
+
finalize_execution
|
|
136
|
+
exit status
|
|
137
|
+
end
|
|
138
|
+
protected :safe_exit
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
end
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
|
|
2
2
|
module CORL
|
|
3
3
|
module Vagrant
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
#
|
|
6
6
|
# Since we can execute CORL actions from within Vagrant on a combination of
|
|
7
|
-
# Vagrant VMs and remote server instances we need a way to tap into the
|
|
7
|
+
# Vagrant VMs and remote server instances we need a way to tap into the
|
|
8
8
|
# Vagrant environment and operate on CORL configured Vagrant machines.
|
|
9
|
-
#
|
|
10
|
-
# This command is set in the CORL launcher Vagrant command plugin execute
|
|
9
|
+
#
|
|
10
|
+
# This command is set in the CORL launcher Vagrant command plugin execute
|
|
11
11
|
# method. It is then accessible anywhere within CORL if we have used that
|
|
12
12
|
# Vagrant command as an execution gateway. If not it will be nil, giving us
|
|
13
13
|
# a convienient method for checking whether we are executing through Vagrant
|
|
14
14
|
# which is used in the CORL Vagrant {Node} and {Machine} plugins.
|
|
15
|
-
#
|
|
15
|
+
#
|
|
16
16
|
@@command = nil
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
def self.command=command
|
|
19
19
|
@@command = command
|
|
20
20
|
end
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
def self.command
|
|
23
23
|
@@command
|
|
24
|
-
end
|
|
24
|
+
end
|
|
25
25
|
end
|
|
26
26
|
end
|
|
27
27
|
|
|
@@ -30,75 +30,76 @@ end
|
|
|
30
30
|
module Nucleon
|
|
31
31
|
module Plugin
|
|
32
32
|
class CloudAction < Nucleon.plugin_class(:nucleon, :action)
|
|
33
|
-
|
|
33
|
+
|
|
34
34
|
#-----------------------------------------------------------------------------
|
|
35
35
|
# Constuctor / Destructor
|
|
36
|
-
|
|
36
|
+
|
|
37
37
|
def normalize(reload)
|
|
38
|
-
super
|
|
39
|
-
|
|
38
|
+
super do
|
|
39
|
+
init_network
|
|
40
|
+
end
|
|
40
41
|
end
|
|
41
|
-
|
|
42
|
+
|
|
42
43
|
#-----------------------------------------------------------------------------
|
|
43
44
|
# Property accessor / modifiers
|
|
44
|
-
|
|
45
|
+
|
|
45
46
|
def self.namespace
|
|
46
47
|
:corl
|
|
47
48
|
end
|
|
48
|
-
|
|
49
|
+
|
|
49
50
|
#---
|
|
50
|
-
|
|
51
|
+
|
|
51
52
|
def network=network
|
|
52
53
|
@network = network
|
|
53
54
|
end
|
|
54
|
-
|
|
55
|
+
|
|
55
56
|
def network
|
|
56
57
|
@network
|
|
57
58
|
end
|
|
58
|
-
|
|
59
|
+
|
|
59
60
|
#---
|
|
60
|
-
|
|
61
|
+
|
|
61
62
|
def configure
|
|
62
63
|
super do
|
|
63
64
|
yield if block_given?
|
|
64
65
|
node_config
|
|
65
66
|
end
|
|
66
67
|
end
|
|
67
|
-
|
|
68
|
+
|
|
68
69
|
#-----------------------------------------------------------------------------
|
|
69
70
|
# Settings
|
|
70
|
-
|
|
71
|
+
|
|
71
72
|
def node_config
|
|
72
73
|
register_str :net_remote, :edit, 'corl.core.action.options.net_remote'
|
|
73
74
|
register_network_provider :net_provider, :corl, [ 'corl.core.action.options.net_provider', 'corl.core.action.errors.network_provider' ]
|
|
74
|
-
|
|
75
|
-
register_node_provider :node_provider, :local, [ 'corl.core.action.options.node_provider', 'corl.core.action.errors.node_provider' ]
|
|
75
|
+
|
|
76
|
+
register_node_provider :node_provider, :local, [ 'corl.core.action.options.node_provider', 'corl.core.action.errors.node_provider' ]
|
|
76
77
|
register_nodes :nodes, [], [ 'corl.core.action.options.nodes', 'corl.core.action.errors.nodes' ]
|
|
77
|
-
|
|
78
|
+
|
|
78
79
|
register_bool :parallel, true, 'corl.core.action.options.parallel'
|
|
79
80
|
end
|
|
80
|
-
|
|
81
|
+
|
|
81
82
|
#---
|
|
82
|
-
|
|
83
|
+
|
|
83
84
|
def node_ignore
|
|
84
85
|
[ :parallel, :node_provider, :nodes ]
|
|
85
86
|
end
|
|
86
|
-
|
|
87
|
+
|
|
87
88
|
#-----------------------------------------------------------------------------
|
|
88
89
|
# Operations
|
|
89
|
-
|
|
90
|
+
|
|
90
91
|
def validate(node = nil, network = nil)
|
|
91
92
|
super(node, network)
|
|
92
93
|
end
|
|
93
|
-
|
|
94
|
+
|
|
94
95
|
#---
|
|
95
|
-
|
|
96
|
+
|
|
96
97
|
def execute(use_network = true, &code)
|
|
97
98
|
if use_network
|
|
98
99
|
super(true, true) do
|
|
99
100
|
node_exec do |node|
|
|
100
101
|
hook_config = { :node => node, :network => network }
|
|
101
|
-
|
|
102
|
+
|
|
102
103
|
code.call(node) if code && extension_check(:exec_init, hook_config)
|
|
103
104
|
myself.status = extension_set(:exec_exit, status, hook_config)
|
|
104
105
|
end
|
|
@@ -107,48 +108,48 @@ class CloudAction < Nucleon.plugin_class(:nucleon, :action)
|
|
|
107
108
|
super(false, false, &code)
|
|
108
109
|
end
|
|
109
110
|
end
|
|
110
|
-
|
|
111
|
+
|
|
111
112
|
#---
|
|
112
|
-
|
|
113
|
+
|
|
113
114
|
def node_exec
|
|
114
|
-
init_network(settings[:net_provider]) unless settings[:net_provider].to_sym == network.plugin_provider
|
|
115
|
-
|
|
115
|
+
init_network(settings[:net_provider]) unless network && settings[:net_provider].to_sym == network.plugin_provider
|
|
116
|
+
|
|
116
117
|
#
|
|
117
118
|
# A fork in the road...
|
|
118
119
|
#
|
|
119
120
|
if network && network.has_nodes? && ! settings[:nodes].empty?
|
|
120
|
-
# Execute action on remote nodes
|
|
121
|
+
# Execute action on remote nodes
|
|
121
122
|
success = network.batch(settings[:nodes], settings[:node_provider], settings[:parallel]) do |node|
|
|
122
123
|
exec_config = Config.new(settings)
|
|
123
124
|
exec_config.delete(:nodes)
|
|
124
|
-
|
|
125
|
+
|
|
125
126
|
result = node.action(plugin_provider, exec_config) do |op, data|
|
|
126
127
|
execute_remote(node, op, data)
|
|
127
128
|
end
|
|
128
|
-
result.status == code.success
|
|
129
|
+
result.status == code.success
|
|
129
130
|
end
|
|
130
131
|
myself.status = code.batch_error unless success
|
|
131
132
|
else
|
|
132
133
|
# Execute statement locally
|
|
133
134
|
node = nil
|
|
134
135
|
node = network.local_node if network
|
|
135
|
-
|
|
136
|
+
|
|
136
137
|
settings[:net_remote] = sanitize_remote(settings[:net_remote]) if settings.has_key?(:net_remote)
|
|
137
|
-
|
|
138
|
+
|
|
138
139
|
if validate(node, network)
|
|
139
140
|
yield(node) if block_given?
|
|
140
141
|
else
|
|
141
142
|
puts "\n" + I18n.t('nucleon.core.exec.help.usage') + ': ' + help + "\n" unless quiet?
|
|
142
|
-
myself.status = code.validation_failed
|
|
143
|
+
myself.status = code.validation_failed
|
|
143
144
|
end
|
|
144
145
|
end
|
|
145
146
|
end
|
|
146
|
-
|
|
147
|
+
|
|
147
148
|
#---
|
|
148
|
-
|
|
149
|
+
|
|
149
150
|
def init_network(provider = nil, path = nil)
|
|
150
151
|
provider = extension_set(:network_provider, :corl) unless provider
|
|
151
|
-
|
|
152
|
+
|
|
152
153
|
# Get network configuration path
|
|
153
154
|
if CORL.admin?
|
|
154
155
|
network_path = lookup(:corl_network)
|
|
@@ -156,59 +157,63 @@ class CloudAction < Nucleon.plugin_class(:nucleon, :action)
|
|
|
156
157
|
else
|
|
157
158
|
network_path = ( path.nil? ? Dir.pwd : File.expand_path(path) )
|
|
158
159
|
end
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
160
|
+
|
|
161
|
+
if File.exists?(File.join(network_path, '.corl'))
|
|
162
|
+
# Load network if it exists
|
|
163
|
+
network_config = extended_config(:network, { :directory => network_path, :new => true })
|
|
164
|
+
@network = CORL.network(network_path, network_config, provider)
|
|
165
|
+
else
|
|
166
|
+
@network = nil
|
|
167
|
+
end
|
|
163
168
|
end
|
|
164
|
-
|
|
169
|
+
|
|
165
170
|
#---
|
|
166
|
-
|
|
171
|
+
|
|
167
172
|
def execute_remote(node, op, data)
|
|
168
173
|
# Implement in sub classes if needed
|
|
169
|
-
data
|
|
174
|
+
data
|
|
170
175
|
end
|
|
171
|
-
|
|
176
|
+
|
|
172
177
|
#---
|
|
173
|
-
|
|
178
|
+
|
|
174
179
|
def ensure_network(&block)
|
|
175
180
|
codes :network_failure
|
|
176
|
-
|
|
181
|
+
|
|
177
182
|
if network
|
|
178
183
|
block.call
|
|
179
184
|
else
|
|
180
185
|
myself.status = code.network_failure
|
|
181
186
|
end
|
|
182
187
|
end
|
|
183
|
-
|
|
188
|
+
|
|
184
189
|
def ensure_node(node, &block)
|
|
185
190
|
codes :node_failure
|
|
186
|
-
|
|
191
|
+
|
|
187
192
|
if node
|
|
188
193
|
block.call
|
|
189
194
|
else
|
|
190
195
|
myself.status = code.node_failure
|
|
191
196
|
end
|
|
192
197
|
end
|
|
193
|
-
|
|
198
|
+
|
|
194
199
|
#-----------------------------------------------------------------------------
|
|
195
200
|
# Utilities
|
|
196
|
-
|
|
201
|
+
|
|
197
202
|
def sanitize_remote(remote)
|
|
198
203
|
remote && ( ! network || network.remote(remote) ) ? remote : nil
|
|
199
204
|
end
|
|
200
|
-
|
|
205
|
+
|
|
201
206
|
#---
|
|
202
|
-
|
|
207
|
+
|
|
203
208
|
def remote_message(remote)
|
|
204
209
|
remote ? "#{remote}" : "LOCAL ONLY"
|
|
205
210
|
end
|
|
206
|
-
|
|
211
|
+
|
|
207
212
|
#---
|
|
208
213
|
|
|
209
214
|
def parse_property_name(property)
|
|
210
215
|
property = property.clone
|
|
211
|
-
|
|
216
|
+
|
|
212
217
|
if property.size > 1
|
|
213
218
|
property.shift.to_s + '[' + property.join('][') + ']'
|
|
214
219
|
else
|