Class: Ansible::Ruby::Modules::Azure_rm_virtualmachine

Inherits:
Base show all
Defined in:
lib/ansible/ruby/modules/generated/core/cloud/azure/azure_rm_virtualmachine.rb

Overview

Create, update, stop and start a virtual machine. Provide an existing storage account and network interface or allow the module to create these for you. If you choose not to provide a network interface, the resource group must contain a virtual network with at least one subnet. Currently requires an image found in the Azure Marketplace. Use azure_rm_virtualmachineimage_facts module to discover the publisher, offer, sku and version of a particular image.

Instance Method Summary collapse

Methods inherited from Base

#ansible_name, #to_h

Methods inherited from Ansible::Ruby::Models::Base

attr_option, attr_options, attribute, #initialize, remove_existing_validations, #to_h, validates

Constructor Details

This class inherits a constructor from Ansible::Ruby::Models::Base

Instance Method Details

#admin_passwordString?

Returns Password for the admin username. Not required if the os_type is Linux and SSH password authentication is disabled by setting ssh_password_enabled to false.

Returns:

  • (String, nil)

    Password for the admin username. Not required if the os_type is Linux and SSH password authentication is disabled by setting ssh_password_enabled to false.



50
# File 'lib/ansible/ruby/modules/generated/core/cloud/azure/azure_rm_virtualmachine.rb', line 50

attribute :admin_password

#admin_usernameString?

Returns Admin username used to access the host after it is created. Required when creating a VM.

Returns:

  • (String, nil)

    Admin username used to access the host after it is created. Required when creating a VM.



46
# File 'lib/ansible/ruby/modules/generated/core/cloud/azure/azure_rm_virtualmachine.rb', line 46

attribute :admin_username

#allocatedBoolean?

Returns Toggle that controls if the machine is allocated/deallocated, only useful with state=‘present’.

Returns:

  • (Boolean, nil)

    Toggle that controls if the machine is allocated/deallocated, only useful with state=‘present’.



28
# File 'lib/ansible/ruby/modules/generated/core/cloud/azure/azure_rm_virtualmachine.rb', line 28

attribute :allocated

#imageHash

Returns A dictionary describing the Marketplace image used to build the VM. Will contain keys: publisher, offer, sku and version. NOTE: set image.version to ‘latest’ to get the most recent version of a given image.

Returns:

  • (Hash)

    A dictionary describing the Marketplace image used to build the VM. Will contain keys: publisher, offer, sku and version. NOTE: set image.version to ‘latest’ to get the most recent version of a given image.



62
# File 'lib/ansible/ruby/modules/generated/core/cloud/azure/azure_rm_virtualmachine.rb', line 62

attribute :image

#locationObject?

Returns Valid Azure location. Defaults to location of the resource group.

Returns:

  • (Object, nil)

    Valid Azure location. Defaults to location of the resource group.



36
# File 'lib/ansible/ruby/modules/generated/core/cloud/azure/azure_rm_virtualmachine.rb', line 36

attribute :location

#nameString

Returns Name of the virtual machine.

Returns:

  • (String)

    Name of the virtual machine.



16
# File 'lib/ansible/ruby/modules/generated/core/cloud/azure/azure_rm_virtualmachine.rb', line 16

attribute :name

#network_interface_namesObject?

Returns List of existing network interface names to add to the VM. If a network interface name is not provided when the VM is created, a default network interface will be created. In order for the module to create a network interface, at least one Virtual Network with one Subnet must exist.

Returns:

  • (Object, nil)

    List of existing network interface names to add to the VM. If a network interface name is not provided when the VM is created, a default network interface will be created. In order for the module to create a network interface, at least one Virtual Network with one Subnet must exist.



91
# File 'lib/ansible/ruby/modules/generated/core/cloud/azure/azure_rm_virtualmachine.rb', line 91

attribute :network_interface_names

#open_portsObject?

Returns If a network interface is created when creating the VM, a security group will be created as well. For Linux hosts a rule will be added to the security group allowing inbound TCP connections to the default SSH port 22, and for Windows hosts ports 3389 and 5986 will be opened. Override the default open ports by providing a list of ports.

Returns:

  • (Object, nil)

    If a network interface is created when creating the VM, a security group will be created as well. For Linux hosts a rule will be added to the security group allowing inbound TCP connections to the default SSH port 22, and for Windows hosts ports 3389 and 5986 will be opened. Override the default open ports by providing a list of ports.



88
# File 'lib/ansible/ruby/modules/generated/core/cloud/azure/azure_rm_virtualmachine.rb', line 88

attribute :open_ports

#os_disk_caching:ReadOnly, ...

Returns Type of OS disk caching.

Returns:

  • (:ReadOnly, :ReadWrite, nil)

    Type of OS disk caching.



76
# File 'lib/ansible/ruby/modules/generated/core/cloud/azure/azure_rm_virtualmachine.rb', line 76

attribute :os_disk_caching

#os_type:Windows, ...

Returns Base type of operating system.

Returns:

  • (:Windows, :Linux, nil)

    Base type of operating system.



80
# File 'lib/ansible/ruby/modules/generated/core/cloud/azure/azure_rm_virtualmachine.rb', line 80

attribute :os_type

#public_ip_allocation_method:Dynamic, ...

Returns If a public IP address is created when creating the VM (beacuse a Network Interface was not provided), determines if the public IP address remains permanently associated with the Network Interface. If set to ‘Dynamic’ the public IP address may change any time the VM is rebooted or power cycled.

Returns:

  • (:Dynamic, :Static, nil)

    If a public IP address is created when creating the VM (beacuse a Network Interface was not provided), determines if the public IP address remains permanently associated with the Network Interface. If set to ‘Dynamic’ the public IP address may change any time the VM is rebooted or power cycled.



84
# File 'lib/ansible/ruby/modules/generated/core/cloud/azure/azure_rm_virtualmachine.rb', line 84

attribute :public_ip_allocation_method

#remove_on_absentString?

Returns When removing a VM using state ‘absent’, also remove associated resources,It can be ‘all’ or a list with any of the following: [‘network_interfaces’, ‘virtual_storage’, ‘public_ips’],Any other input will be ignored.

Returns:

  • (String, nil)

    When removing a VM using state ‘absent’, also remove associated resources,It can be ‘all’ or a list with any of the following: [‘network_interfaces’, ‘virtual_storage’, ‘public_ips’],Any other input will be ignored



100
# File 'lib/ansible/ruby/modules/generated/core/cloud/azure/azure_rm_virtualmachine.rb', line 100

attribute :remove_on_absent

#resource_groupString, NilClass

Returns Name of the resource group containing the virtual machine.

Returns:

  • (String, NilClass)

    Name of the resource group containing the virtual machine.



12
# File 'lib/ansible/ruby/modules/generated/core/cloud/azure/azure_rm_virtualmachine.rb', line 12

attribute :resource_group

#restartedBoolean?

Returns Use with state ‘present’ to restart a running VM.

Returns:

  • (Boolean, nil)

    Use with state ‘present’ to restart a running VM.



32
# File 'lib/ansible/ruby/modules/generated/core/cloud/azure/azure_rm_virtualmachine.rb', line 32

attribute :restarted

#short_hostnameObject?

Returns Name assigned internally to the host. On a linux VM this is the name returned by the ‘hostname` command. When creating a virtual machine, short_hostname defaults to name.

Returns:

  • (Object, nil)

    Name assigned internally to the host. On a linux VM this is the name returned by the ‘hostname` command. When creating a virtual machine, short_hostname defaults to name.



39
# File 'lib/ansible/ruby/modules/generated/core/cloud/azure/azure_rm_virtualmachine.rb', line 39

attribute :short_hostname

#ssh_password_enabledBoolean?

Returns When the os_type is Linux, setting ssh_password_enabled to false will disable SSH password authentication and require use of SSH keys.

Returns:

  • (Boolean, nil)

    When the os_type is Linux, setting ssh_password_enabled to false will disable SSH password authentication and require use of SSH keys.



54
# File 'lib/ansible/ruby/modules/generated/core/cloud/azure/azure_rm_virtualmachine.rb', line 54

attribute :ssh_password_enabled

#ssh_public_keysHash?

Returns For os_type Linux provide a list of SSH keys. Each item in the list should be a dictionary where the dictionary contains two keys: path and key_data. Set the path to the default location of the authorized_keys files. On an Enterprise Linux host, for example, the path will be /home/<admin username>/.ssh/authorized_keys. Set key_data to the actual value of the public key.

Returns:

  • (Hash, nil)

    For os_type Linux provide a list of SSH keys. Each item in the list should be a dictionary where the dictionary contains two keys: path and key_data. Set the path to the default location of the authorized_keys files. On an Enterprise Linux host, for example, the path will be /home/<admin username>/.ssh/authorized_keys. Set key_data to the actual value of the public key.



58
# File 'lib/ansible/ruby/modules/generated/core/cloud/azure/azure_rm_virtualmachine.rb', line 58

attribute :ssh_public_keys

#startedBoolean?

Returns Use with state ‘present’ to start the machine. Set to false to have the machine be ‘stopped’.

Returns:

  • (Boolean, nil)

    Use with state ‘present’ to start the machine. Set to false to have the machine be ‘stopped’.



24
# File 'lib/ansible/ruby/modules/generated/core/cloud/azure/azure_rm_virtualmachine.rb', line 24

attribute :started

#state:absent, ...

Returns Assert the state of the virtual machine.,State ‘present’ will check that the machine exists with the requested configuration. If the configuration of the existing machine does not match, the machine will be updated. Use options started, allocated and restarted to change the machine’s power state.,State ‘absent’ will remove the virtual machine.

Returns:

  • (:absent, :present, nil)

    Assert the state of the virtual machine.,State ‘present’ will check that the machine exists with the requested configuration. If the configuration of the existing machine does not match, the machine will be updated. Use options started, allocated and restarted to change the machine’s power state.,State ‘absent’ will remove the virtual machine.



20
# File 'lib/ansible/ruby/modules/generated/core/cloud/azure/azure_rm_virtualmachine.rb', line 20

attribute :state

#storage_account_nameObject?

Returns Name of an existing storage account that supports creation of VHD blobs. If not specified for a new VM, a new storage account named <vm name>01 will be created using storage type ‘Standard_LRS’.

Returns:

  • (Object, nil)

    Name of an existing storage account that supports creation of VHD blobs. If not specified for a new VM, a new storage account named <vm name>01 will be created using storage type ‘Standard_LRS’.



66
# File 'lib/ansible/ruby/modules/generated/core/cloud/azure/azure_rm_virtualmachine.rb', line 66

attribute :storage_account_name

#storage_blob_nameObject?

Returns Name fo the storage blob used to hold the VM’s OS disk image. If no name is provided, defaults to the VM name + ‘.vhd’. If you provide a name, it must end with ‘.vhd’.

Returns:

  • (Object, nil)

    Name fo the storage blob used to hold the VM’s OS disk image. If no name is provided, defaults to the VM name + ‘.vhd’. If you provide a name, it must end with ‘.vhd’



73
# File 'lib/ansible/ruby/modules/generated/core/cloud/azure/azure_rm_virtualmachine.rb', line 73

attribute :storage_blob_name

#storage_container_nameString?

Returns Name of the container to use within the storage account to store VHD blobs. If no name is specified a default container will created.

Returns:

  • (String, nil)

    Name of the container to use within the storage account to store VHD blobs. If no name is specified a default container will created.



69
# File 'lib/ansible/ruby/modules/generated/core/cloud/azure/azure_rm_virtualmachine.rb', line 69

attribute :storage_container_name

#subnet_nameObject?

Returns When creating a virtual machine, if a network interface name is not provided, one will be created. The new network interface will be assigned to the first subnet found in the virtual network. Use this parameter to provide a specific subnet instead.

Returns:

  • (Object, nil)

    When creating a virtual machine, if a network interface name is not provided, one will be created. The new network interface will be assigned to the first subnet found in the virtual network. Use this parameter to provide a specific subnet instead.



97
# File 'lib/ansible/ruby/modules/generated/core/cloud/azure/azure_rm_virtualmachine.rb', line 97

attribute :subnet_name

#virtual_network_nameObject?

Returns When creating a virtual machine, if a network interface name is not provided, one will be created. The new network interface will be assigned to the first virtual network found in the resource group. Use this parameter to provide a specific virtual network instead.

Returns:

  • (Object, nil)

    When creating a virtual machine, if a network interface name is not provided, one will be created. The new network interface will be assigned to the first virtual network found in the resource group. Use this parameter to provide a specific virtual network instead.



94
# File 'lib/ansible/ruby/modules/generated/core/cloud/azure/azure_rm_virtualmachine.rb', line 94

attribute :virtual_network_name

#vm_sizeString?

Returns A valid Azure VM size value. For example, ‘Standard_D4’. The list of choices varies depending on the subscription and location. Check your subscription for available choices.

Returns:

  • (String, nil)

    A valid Azure VM size value. For example, ‘Standard_D4’. The list of choices varies depending on the subscription and location. Check your subscription for available choices.



42
# File 'lib/ansible/ruby/modules/generated/core/cloud/azure/azure_rm_virtualmachine.rb', line 42

attribute :vm_size