Last active
January 12, 2021 14:22
-
-
Save IPvSean/70255ff9dd3d663b98fcf4dfff654991 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Create VM | |
azure.azcollection.azure_rm_virtualmachine: | |
resource_group: myResourceGroup | |
name: RHEL8-ansible | |
vm_size: Standard_DS1_v2 | |
admin_username: azureuser | |
ssh_password_enabled: false | |
ssh_public_keys: | |
- path: /home/azureuser/.ssh/authorized_keys | |
key_data: "{{public_key}}" | |
network_interfaces: myNIC | |
image: | |
offer: RHEL | |
publisher: RedHat | |
sku: '8.1' | |
version: latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(azure) ➜ azure git:(master) ✗ ansible-playbook spin_up_rhel.yml | |
PLAY [Create Azure VM] ************************************************************************************************************************************************************** | |
TASK [Create resource group] ******************************************************************************************************************************************************** | |
ok: [localhost] | |
TASK [Create virtual network] ******************************************************************************************************************************************************* | |
ok: [localhost] | |
TASK [Add subnet] ******************************************************************************************************************************************************************* | |
ok: [localhost] | |
TASK [Create public IP address] ***************************************************************************************************************************************************** | |
ok: [localhost] | |
TASK [Dump public IP for VM which will be created] ********************************************************************************************************************************** | |
ok: [localhost] => { | |
"msg": "The public IP is 52.188.208.206" | |
} | |
TASK [Create Network Security Group that allows SSH] ******************************************************************************************************************************** | |
ok: [localhost] | |
TASK [Create virtual network inteface card] ***************************************************************************************************************************************** | |
ok: [localhost] | |
TASK [Create VM] ******************************************************************************************************************************************************************** | |
changed: [localhost] | |
PLAY RECAP ************************************************************************************************************ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment