Sha256: de91e29cd560313d5bd772c8e67508b9cf18c388665bf0ac311086d2cdcde025

Contents?: true

Size: 600 Bytes

Versions: 4

Compression:

Stored size: 600 Bytes

Contents

require 'oscar'

class Oscar::Environment
  attr_reader :networking
  attr_reader :config

  def initialize
    @config     = Oscar::Config.new
    @nodes = []
  end

  def run!
    @networking = Oscar::Networking.new(@config.data["networking"])
    nodes       = @config.all_node_configs

    # TODO make sure that the master is provisioned before any agents.
    nodes.each do |node_attrs|
      node = Oscar::Node.new(node_attrs)
      @networking.register(node)

      @nodes << node
    end

    Vagrant::Config.run do |config|
      @nodes.each { |node| node.define(config) }
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
oscar-0.2.0alpha5 lib/oscar/environment.rb
oscar-0.2.0alpha3 lib/oscar/environment.rb
oscar-0.2.0alpha2 lib/oscar/environment.rb
oscar-0.2.0alpha1 lib/oscar/environment.rb