module CORL::Facade

Public Instance Methods

builder(options, provider = nil) click to toggle source
    # File lib/core/facade.rb
109 def builder(options, provider = nil)
110   plugin(:CORL, :builder, provider, options)
111 end
builders(data, build_hash = false, keep_array = false) click to toggle source
    # File lib/core/facade.rb
113 def builders(data, build_hash = false, keep_array = false)
114   plugins(:CORL, :builder, data, build_hash, keep_array)
115 end
configuration(options, provider = nil) click to toggle source
   # File lib/core/facade.rb
78 def configuration(options, provider = nil)
79   plugin(:CORL, :configuration, provider, options)
80 end
configurations(data, build_hash = false, keep_array = false) click to toggle source
   # File lib/core/facade.rb
82 def configurations(data, build_hash = false, keep_array = false)
83   plugins(:CORL, :configuration, data, build_hash, keep_array)
84 end
create_fact(name, value, weight = 1000) click to toggle source
   # File lib/core/facade.rb
24 def create_fact(name, value, weight = 1000)
25   Facter.collection.add(name.to_sym, {
26     :value  => value,
27     :weight => weight
28   })
29 end
fact(name) click to toggle source
   # File lib/core/facade.rb
33 def fact(name)
34   silence do
35     Facter.value(name)
36   end
37 end
facts(reset = false) click to toggle source
   # File lib/core/facade.rb
10 def facts(reset = false)
11   if reset || @@facts.empty?
12     @@facts = {} if reset
13     silence do
14       Facter.list.each do |name|
15         @@facts[name] = Facter.value(name)
16       end
17     end
18   end
19   @@facts
20 end
network(name, options = {}, provider = nil) click to toggle source
   # File lib/core/facade.rb
89 def network(name, options = {}, provider = nil)
90   plugin(:CORL, :network, provider, Config.ensure(options).import({ :name => name }))
91 end
networks(data, build_hash = false, keep_array = false) click to toggle source
   # File lib/core/facade.rb
93 def networks(data, build_hash = false, keep_array = false)
94   plugins(:CORL, :network, data, build_hash, keep_array)
95 end
node(name, options = {}, provider = nil) click to toggle source
    # File lib/core/facade.rb
 99 def node(name, options = {}, provider = nil)
100   plugin(:CORL, :node, provider, Config.ensure(options).import({ :name => name }))
101 end
nodes(data, build_hash = false, keep_array = false) click to toggle source
    # File lib/core/facade.rb
103 def nodes(data, build_hash = false, keep_array = false)
104   plugins(:CORL, :node, data, build_hash, keep_array)
105 end
provisioner(options, provider = nil) click to toggle source
    # File lib/core/facade.rb
119 def provisioner(options, provider = nil)
120   plugin(:CORL, :provisioner, provider, options)
121 end
provisioners(data, build_hash = false, keep_array = false) click to toggle source
    # File lib/core/facade.rb
123 def provisioners(data, build_hash = false, keep_array = false)
124   plugins(:CORL, :provisioner, data, build_hash, keep_array)
125 end
public_ip() click to toggle source
   # File lib/core/facade.rb
42 def public_ip
43   if Config.fact(:vagrant_exists)
44     ip_address = Config.fact(:ipaddress_eth1)
45     ip_address = Config.fact(:ipaddress_eth0) unless ip_address
46     ip_address
47   elsif Config.fact(:raspberry_pi)
48     ip_address = Config.fact(:ipaddress_eth0)
49     ip_address
50   else
51     CORL.ip_address
52   end
53 end
vagrant?() click to toggle source
   # File lib/core/facade.rb
58 def vagrant?
59   Vagrant.command ? true : false
60 end
vagrant_config(directory, config, &code) click to toggle source
   # File lib/core/facade.rb
70 def vagrant_config(directory, config, &code)
71   Vagrant::Config.register(directory, config, &code)
72   @@vagrant_config_loaded = true
73 end
vagrant_config_loaded?() click to toggle source
   # File lib/core/facade.rb
66 def vagrant_config_loaded?
67   @@vagrant_config_loaded
68 end