ansible / ansible.builtin / v2.3.2.0-1 / module / azure create or terminate a virtual machine in azure | "added in version" 1.7 of ansible.builtin" Authors: John Whitbeck (@jwhitbeck) preview | supported by communityansible.builtin.azure (v2.3.2.0-1) — module
pip
Install with pip install ansible==2.3.2.0.post1
Creates or terminates azure instances. When created optionally waits for it to be 'running'.
# Note: None of these examples set subscription_id or management_cert_path # It is assumed that their matching environment variables are set. - name: Provision virtual machine example azure: name: my-virtual-machine role_size: Small image: b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-precise-12_04_3-LTS-amd64-server-20131205-en-us-30GB location: East US user: ubuntu ssh_cert_path: /path/to/azure_x509_cert.pem storage_account: my-storage-account wait: True state: present delegate_to: localhost
- name: Terminate virtual machine example azure: name: my-virtual-machine state: absent delegate_to: localhost
- name: Create windows machine azure: name: ben-Winows-23 hostname: win123 os_type: windows enable_winrm: True subscription_id: '{{ azure_sub_id }}' management_cert_path: '{{ azure_cert_path }}' role_size: Small image: bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2012-x64-v13.5 location: East Asia password: xxx storage_account: benooytes user: admin wait: True state: present virtual_network_name: '{{ vnet_name }}' delegate_to: localhost
name: default: null description: - name of the virtual machine and associated cloud service. required: true user: default: null description: - the unix username for the new virtual machine. required: false wait: aliases: [] choices: - 'yes' - 'no' default: 'no' description: - wait for the instance to be in state 'running' before returning required: false image: default: null description: - system image for creating the virtual machine (e.g., b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-precise-12_04_3-LTS-amd64-server-20131205-en-us-30GB) required: true state: aliases: [] default: present description: - create or terminate instances required: false os_type: choices: - windows - linux default: linux description: - The type of the os that is gettings provisioned required: false version_added: '2.0' version_added_collection: ansible.builtin hostname: default: null description: - hostname to write /etc/hostname. Defaults to <name>.cloudapp.net. required: false location: default: null description: - the azure location to use (e.g. 'East US') required: true password: default: null description: - the unix password for the new virtual machine. required: false endpoints: default: 22 description: - a comma-separated list of TCP ports to expose on the virtual machine (e.g., "22,80") required: false role_size: default: Small description: - azure role size for the new virtual machine (e.g., Small, ExtraLarge, A6). You have to pay attention to the fact that instances of type G and DS are not available in all regions (locations). Make sure if you selected the size and type of instance available in your chosen location. required: false auto_updates: choices: - 'yes' - 'no' default: 'no' description: - Enable Auto Updates on Windows Machines required: false version_added: '2.0' version_added_collection: ansible.builtin enable_winrm: choices: - 'yes' - 'no' default: 'yes' description: - Enable winrm on Windows Machines required: false version_added: '2.0' version_added_collection: ansible.builtin wait_timeout: aliases: [] default: 600 description: - how long before wait gives up, in seconds ssh_cert_path: default: null description: - path to an X509 certificate containing the public ssh key to install in the virtual machine. See http://www.windowsazure.com/en-us/manage/linux/tutorials/intro-to-linux/ for more details. - if this option is specified, password-based ssh authentication will be disabled. required: false storage_account: description: - the azure storage account in which to store the data disks. required: true subscription_id: default: null description: - azure subscription id. Overrides the AZURE_SUBSCRIPTION_ID environment variable. required: false management_cert_path: default: null description: - path to an azure management certificate associated with the subscription id. Overrides the AZURE_CERT_PATH environment variable. required: false virtual_network_name: default: null description: - Name of virtual network. required: false wait_timeout_redirects: aliases: [] default: 300 description: - how long before wait gives up for redirects, in seconds