class VagrantPlugins::OpenStack::Config
Attributes
@return [String]
The endpoint to access OpenStack
.
@return [String]
The flavor of server to launch, either the ID or name. This can also be a regular expression to partially match a name.
The name or ID of the image to use. This can also be a regular expression to partially match a name.
The name of the keypair to use.
@return [String]
Metadata to be sent to the newly created OpenStack
instance.
@return [Hash]
@return [String]
@return [String]
Openstack region, if your openstack instance uses these. Rackspace typically uses these. You need to provide their three letter acronym (for example: DFW) @return [String]
@return [Hash]
The name of the server. This defaults to the name of the machine defined by Vagrant (via ‘config.vm.define`), but can be overriden here.
The SSH username to use with this OpenStack
instance. This overrides the ‘config.ssh.username` variable.
@return [String]
@return [String]
User data to be sent to the newly created OpenStack
instance. Use this e.g. to inject a script at boot time.
@return [String]
The username to access OpenStack
.
@return [String]
Public Class Methods
# File lib/vagrant-openstack/config.rb, line 73 def initialize @api_key = UNSET_VALUE @endpoint = UNSET_VALUE @region = UNSET_VALUE @flavor = UNSET_VALUE @image = UNSET_VALUE @server_name = UNSET_VALUE @username = UNSET_VALUE @keypair_name = UNSET_VALUE @ssh_username = UNSET_VALUE @user_data = UNSET_VALUE @metadata = UNSET_VALUE @public_network_name = UNSET_VALUE @networks = UNSET_VALUE @tenant = UNSET_VALUE @scheduler_hints = UNSET_VALUE end
Public Instance Methods
# File lib/vagrant-openstack/config.rb, line 91 def finalize! @api_key = nil if @api_key == UNSET_VALUE @endpoint = nil if @endpoint == UNSET_VALUE @region = nil if @region == UNSET_VALUE @flavor = /m1.tiny/ if @flavor == UNSET_VALUE @image = /cirros/ if @image == UNSET_VALUE @server_name = nil if @server_name == UNSET_VALUE @username = nil if @username == UNSET_VALUE # Keypair defaults to nil @keypair_name = nil if @keypair_name == UNSET_VALUE # The SSH values by default are nil, and the top-level config # `config.ssh` values are used. @ssh_username = nil if @ssh_username == UNSET_VALUE @user_data = "" if @user_data == UNSET_VALUE @metadata = {} if @metadata == UNSET_VALUE @public_network_name = "public" if @public_network_name == UNSET_VALUE @networks = [@public_network_name] if @networks == UNSET_VALUE @tenant = nil if @tenant == UNSET_VALUE @scheduler_hints = {} if @scheduler_hints == UNSET_VALUE end
# File lib/vagrant-openstack/config.rb, line 116 def validate(machine) errors = [] errors << I18n.t("vagrant_openstack.config.api_key_required") if !@api_key errors << I18n.t("vagrant_openstack.config.username_required") if !@username { "OpenStack Provider" => errors } end