Class: VagrantPlugins::Compose::Config
- Inherits:
-
Object
- Object
- VagrantPlugins::Compose::Config
- Defined in:
- lib/vagrant/compose/config.rb
Instance Attribute Summary collapse
-
#ansible_groups ⇒ Object
readonly
Returns the value of attribute ansible_groups.
-
#nodes ⇒ Object
readonly
Returns the value of attribute nodes.
Instance Method Summary collapse
- #compose(name, &block) ⇒ Object
- #debug ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
11 12 13 14 |
# File 'lib/vagrant/compose/config.rb', line 11 def initialize @nodes = {} @ansible_groups = {} end |
Instance Attribute Details
#ansible_groups ⇒ Object (readonly)
Returns the value of attribute ansible_groups.
9 10 11 |
# File 'lib/vagrant/compose/config.rb', line 9 def ansible_groups @ansible_groups end |
#nodes ⇒ Object (readonly)
Returns the value of attribute nodes.
9 10 11 |
# File 'lib/vagrant/compose/config.rb', line 9 def nodes @nodes end |
Instance Method Details
#compose(name, &block) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/vagrant/compose/config.rb', line 16 def compose (name, &block) # implementa la creazione di un cluster, l'esecuzione di un blocco di codice # per la configurazione del cluster stesso, e l'esecuzione della sequenza di compose. @cluster = Cluster.new(name) begin block.call(@cluster) rescue Exception => e raise VagrantPlugins::Compose::Errors::ClusterInitializeError, :message => e., :cluster_name => name end @nodes, @ansible_groups = @cluster.compose end |
#debug ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/vagrant/compose/config.rb', line 28 def debug puts "==> cluster #{@cluster.name} with #{nodes.size} nodes" @nodes.each do |node| puts " #{node.boxname} accessible as #{node.fqdn} #{node.aliases} #{node.ip} => [#{node.box}, #{node.cpus} cpus, #{node.memory} memory]" end puts " ansible_groups filtered by #{@cluster.multimachine_filter}" if not @cluster.multimachine_filter.empty? end |