Sha256: 98648a3c12063614d4718cc6d4ea126438e4199ae5c74fcfa4db47066b7f30a4

Contents?: true

Size: 1009 Bytes

Versions: 10

Compression:

Stored size: 1009 Bytes

Contents

module Vcloud
  module NetLauncher
    class NetLaunch

      # Initializes instance variables.
      #
      # @return [void]
      def initialize
        @config_loader = Vcloud::Core::ConfigLoader.new
      end

      # Parses a configuration file and provisions the networks it defines.
      #
      # @param  config_file [String]  Path to a YAML or JSON-formatted configuration file
      # @return [void]
      def run(config_file = nil)
        config = @config_loader.load_config(config_file, Vcloud::NetLauncher::Schema::NET_LAUNCH)

        config[:org_vdc_networks].each do |net_config|
          net_config[:fence_mode] ||= 'isolated'
          Vcloud::Core.logger.info("Provisioning orgVdcNetwork #{net_config[:name]}.")
          begin
            Vcloud::Core::OrgVdcNetwork.provision(net_config)
          rescue RuntimeError => e
            Vcloud::Core.logger.error("Could not provision orgVdcNetwork: #{e.message}")
            raise
          end
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
vcloud-net_launcher-2.1.1 lib/vcloud/net_launcher/net_launch.rb
vcloud-net_launcher-2.1.0 lib/vcloud/net_launcher/net_launch.rb
vcloud-net_launcher-2.0.0 lib/vcloud/net_launcher/net_launch.rb
vcloud-net_launcher-1.0.1 lib/vcloud/net_launcher/net_launch.rb
vcloud-net_launcher-1.0.0 lib/vcloud/net_launcher/net_launch.rb
vcloud-net_launcher-0.8.0 lib/vcloud/net_launcher/net_launch.rb
vcloud-net_launcher-0.7.0 lib/vcloud/net_launcher/net_launch.rb
vcloud-net_launcher-0.6.0 lib/vcloud/net_launcher/net_launch.rb
vcloud-net_launcher-0.5.1 lib/vcloud/net_launcher/net_launch.rb
vcloud-net_launcher-0.5.0 lib/vcloud/net_launcher/net_launch.rb