Class: Ansible::Ruby::Modules::Azure_rm_virtualmachine
- Inherits:
-
Base
- Object
- Ansible::Ruby::Models::Base
- Base
- Ansible::Ruby::Modules::Azure_rm_virtualmachine
- Defined in:
- lib/ansible/ruby/modules/generated/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. Before Ansible 2.5, this required an image found in the Azure Marketplace which can be discovered with M(azure_rm_virtualmachineimage_facts). In Ansible 2.5 and newer, custom images can be used as well, see the examples for more details.
Instance Method Summary collapse
-
#accept_terms ⇒ Symbol?
Accept terms for marketplace images that require it,Only Azure service admin/account admin users can purchase images from the marketplace.
-
#admin_password ⇒ String?
Password for the admin username.
-
#admin_username ⇒ String?
Admin username used to access the host after it is created.
-
#allocated ⇒ Boolean?
Toggle that controls if the machine is allocated/deallocated, only useful with state=‘present’.
-
#availability_set ⇒ String?
Name or ID of an existing availability set to add the VM to.
-
#custom_data ⇒ Object?
Data which is made available to the virtual machine and used by e.g., cloud-init.
-
#data_disks ⇒ Array<Hash>, ...
Describes list of data disks.
-
#image ⇒ Hash, String
Specifies the image used to build the VM.,If a string, the image is sourced from a custom image based on the name.,If a dict with the keys C(publisher), C(offer), C(sku), and C(version), the image is sourced from a Marketplace image.
-
#location ⇒ Object?
Valid Azure location.
-
#managed_disk_type ⇒ :Standard_LRS, ...
Managed OS disk type.
-
#name ⇒ String
Name of the virtual machine.
-
#network_interface_names ⇒ Object?
List of existing network interface names to add to the VM.,Item can be a str of name or resource id of the network interface.,Item can also be a dict contains C(resource_group) and C(name) of the network interface.,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 new network interface, at least one Virtual Network with one Subnet must exist.
-
#open_ports ⇒ Object?
If a network interface is created when creating the VM, a security group will be created as well.
-
#os_disk_caching ⇒ :ReadOnly, ...
Type of OS disk caching.
-
#os_disk_size_gb ⇒ Integer?
Type of OS disk size in GB.
-
#os_type ⇒ :Windows, ...
Base type of operating system.
-
#plan ⇒ Hash?
A dictionary describing a third-party billing plan for an instance.
-
#public_ip_allocation_method ⇒ :Dynamic, ...
If a public IP address is created when creating the VM (because a Network Interface was not provided), determines if the public IP address remains permanently associated with the Network Interface.
-
#remove_on_absent ⇒ String?
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.
-
#resource_group ⇒ String, NilClass
Name of the resource group containing the virtual machine.
-
#restarted ⇒ Symbol?
Use with state ‘present’ to restart a running VM.
-
#short_hostname ⇒ Object?
Name assigned internally to the host.
-
#ssh_password_enabled ⇒ Boolean?
When the os_type is Linux, setting ssh_password_enabled to false will disable SSH password authentication and require use of SSH keys.
-
#ssh_public_keys ⇒ Array<Hash>, ...
For os_type Linux provide a list of SSH keys.
-
#started ⇒ Boolean?
Use with state ‘present’ to start the machine.
-
#state ⇒ :absent, ...
Assert the state of the virtual machine.,State ‘present’ will check that the machine exists with the requested configuration.
-
#storage_account_name ⇒ Object?
Name of an existing storage account that supports creation of VHD blobs.
-
#storage_blob_name ⇒ Object?
Name fo the storage blob used to hold the VM’s OS disk image.
-
#storage_container_name ⇒ String?
Name of the container to use within the storage account to store VHD blobs.
-
#subnet_name ⇒ Object?
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.,If the subnet is in another resource group, specific resource group by C(virtual_network_resource_group).
-
#virtual_network_name ⇒ Object?
When creating a virtual machine, if a network interface name is not provided, one will be created.,The 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.,If the virtual network in in another resource group, specific resource group by C(virtual_network_resource_group).
-
#virtual_network_resource_group ⇒ Object?
When creating a virtual machine, if a specific virtual network from another resource group should be used, use this parameter to specify the resource group to use.
-
#vm_size ⇒ String?
A valid Azure VM size value.
Methods inherited from Base
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
#accept_terms ⇒ Symbol?
131 |
# File 'lib/ansible/ruby/modules/generated/cloud/azure/azure_rm_virtualmachine.rb', line 131 attribute :accept_terms |
#admin_password ⇒ String?
54 |
# File 'lib/ansible/ruby/modules/generated/cloud/azure/azure_rm_virtualmachine.rb', line 54 attribute :admin_password |
#admin_username ⇒ String?
50 |
# File 'lib/ansible/ruby/modules/generated/cloud/azure/azure_rm_virtualmachine.rb', line 50 attribute :admin_username |
#allocated ⇒ Boolean?
32 |
# File 'lib/ansible/ruby/modules/generated/cloud/azure/azure_rm_virtualmachine.rb', line 32 attribute :allocated |
#availability_set ⇒ String?
70 |
# File 'lib/ansible/ruby/modules/generated/cloud/azure/azure_rm_virtualmachine.rb', line 70 attribute :availability_set |
#custom_data ⇒ Object?
21 |
# File 'lib/ansible/ruby/modules/generated/cloud/azure/azure_rm_virtualmachine.rb', line 21 attribute :custom_data |
#data_disks ⇒ Array<Hash>, ...
100 |
# File 'lib/ansible/ruby/modules/generated/cloud/azure/azure_rm_virtualmachine.rb', line 100 attribute :data_disks |
#image ⇒ Hash, String
66 |
# File 'lib/ansible/ruby/modules/generated/cloud/azure/azure_rm_virtualmachine.rb', line 66 attribute :image |
#location ⇒ Object?
40 |
# File 'lib/ansible/ruby/modules/generated/cloud/azure/azure_rm_virtualmachine.rb', line 40 attribute :location |
#managed_disk_type ⇒ :Standard_LRS, ...
84 |
# File 'lib/ansible/ruby/modules/generated/cloud/azure/azure_rm_virtualmachine.rb', line 84 attribute :managed_disk_type |
#name ⇒ String
17 |
# File 'lib/ansible/ruby/modules/generated/cloud/azure/azure_rm_virtualmachine.rb', line 17 attribute :name |
#network_interface_names ⇒ Object?
111 |
# File 'lib/ansible/ruby/modules/generated/cloud/azure/azure_rm_virtualmachine.rb', line 111 attribute :network_interface_names |
#open_ports ⇒ Object?
108 |
# File 'lib/ansible/ruby/modules/generated/cloud/azure/azure_rm_virtualmachine.rb', line 108 attribute :open_ports |
#os_disk_caching ⇒ :ReadOnly, ...
88 |
# File 'lib/ansible/ruby/modules/generated/cloud/azure/azure_rm_virtualmachine.rb', line 88 attribute :os_disk_caching |
#os_disk_size_gb ⇒ Integer?
92 |
# File 'lib/ansible/ruby/modules/generated/cloud/azure/azure_rm_virtualmachine.rb', line 92 attribute :os_disk_size_gb |
#os_type ⇒ :Windows, ...
96 |
# File 'lib/ansible/ruby/modules/generated/cloud/azure/azure_rm_virtualmachine.rb', line 96 attribute :os_type |
#plan ⇒ Hash?
127 |
# File 'lib/ansible/ruby/modules/generated/cloud/azure/azure_rm_virtualmachine.rb', line 127 attribute :plan |
#public_ip_allocation_method ⇒ :Dynamic, ...
104 |
# File 'lib/ansible/ruby/modules/generated/cloud/azure/azure_rm_virtualmachine.rb', line 104 attribute :public_ip_allocation_method |
#remove_on_absent ⇒ String?
123 |
# File 'lib/ansible/ruby/modules/generated/cloud/azure/azure_rm_virtualmachine.rb', line 123 attribute :remove_on_absent |
#resource_group ⇒ String, NilClass
13 |
# File 'lib/ansible/ruby/modules/generated/cloud/azure/azure_rm_virtualmachine.rb', line 13 attribute :resource_group |
#restarted ⇒ Symbol?
36 |
# File 'lib/ansible/ruby/modules/generated/cloud/azure/azure_rm_virtualmachine.rb', line 36 attribute :restarted |
#short_hostname ⇒ Object?
43 |
# File 'lib/ansible/ruby/modules/generated/cloud/azure/azure_rm_virtualmachine.rb', line 43 attribute :short_hostname |
#ssh_password_enabled ⇒ Boolean?
58 |
# File 'lib/ansible/ruby/modules/generated/cloud/azure/azure_rm_virtualmachine.rb', line 58 attribute :ssh_password_enabled |
#ssh_public_keys ⇒ Array<Hash>, ...
62 |
# File 'lib/ansible/ruby/modules/generated/cloud/azure/azure_rm_virtualmachine.rb', line 62 attribute :ssh_public_keys |
#started ⇒ Boolean?
28 |
# File 'lib/ansible/ruby/modules/generated/cloud/azure/azure_rm_virtualmachine.rb', line 28 attribute :started |
#state ⇒ :absent, ...
24 |
# File 'lib/ansible/ruby/modules/generated/cloud/azure/azure_rm_virtualmachine.rb', line 24 attribute :state |
#storage_account_name ⇒ Object?
74 |
# File 'lib/ansible/ruby/modules/generated/cloud/azure/azure_rm_virtualmachine.rb', line 74 attribute :storage_account_name |
#storage_blob_name ⇒ Object?
81 |
# File 'lib/ansible/ruby/modules/generated/cloud/azure/azure_rm_virtualmachine.rb', line 81 attribute :storage_blob_name |
#storage_container_name ⇒ String?
77 |
# File 'lib/ansible/ruby/modules/generated/cloud/azure/azure_rm_virtualmachine.rb', line 77 attribute :storage_container_name |
#subnet_name ⇒ Object?
120 |
# File 'lib/ansible/ruby/modules/generated/cloud/azure/azure_rm_virtualmachine.rb', line 120 attribute :subnet_name |
#virtual_network_name ⇒ Object?
117 |
# File 'lib/ansible/ruby/modules/generated/cloud/azure/azure_rm_virtualmachine.rb', line 117 attribute :virtual_network_name |
#virtual_network_resource_group ⇒ Object?
114 |
# File 'lib/ansible/ruby/modules/generated/cloud/azure/azure_rm_virtualmachine.rb', line 114 attribute :virtual_network_resource_group |
#vm_size ⇒ String?
46 |
# File 'lib/ansible/ruby/modules/generated/cloud/azure/azure_rm_virtualmachine.rb', line 46 attribute :vm_size |