From 3be7357fc97edf99f62041c1a7ce97cc6dfc7a74 Mon Sep 17 00:00:00 2001 From: David Rojas Date: Fri, 25 Sep 2020 12:35:15 -0700 Subject: [PATCH] correcting unordered lists --- .../infrastructure/azure_provision_vm.yml | 64 +++++++++++++++++++ .../infrastructure/chocolatey_app_install.yml | 2 +- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 playbooks/infrastructure/azure_provision_vm.yml diff --git a/playbooks/infrastructure/azure_provision_vm.yml b/playbooks/infrastructure/azure_provision_vm.yml new file mode 100644 index 0000000..43b99f3 --- /dev/null +++ b/playbooks/infrastructure/azure_provision_vm.yml @@ -0,0 +1,64 @@ +# Description +# =========== +# This playbook create an Azure VM with public IP, and open 22 port for SSH + +- name: Create Azure VM + hosts: localhost + connection: local + vars: + resource_group: "{{ resource_group_name }}" + vm_name: testvm + location: eastus + tasks: + - name: Create a resource group + azure_rm_resourcegroup: + name: "{{ resource_group }}" + location: "{{ location }}" + - name: Create virtual network + azure_rm_virtualnetwork: + resource_group: "{{ resource_group }}" + name: "{{ vm_name }}" + address_prefixes: "10.0.0.0/16" + - name: Add subnet + azure_rm_subnet: + resource_group: "{{ resource_group }}" + name: "{{ vm_name }}" + address_prefix: "10.0.1.0/24" + virtual_network: "{{ vm_name }}" + - name: Create public IP address + azure_rm_publicipaddress: + resource_group: "{{ resource_group }}" + allocation_method: Static + name: "{{ vm_name }}" + - name: Create Network Security Group that allows SSH + azure_rm_securitygroup: + resource_group: "{{ resource_group }}" + name: "{{ vm_name }}" + rules: + - name: SSH + protocol: Tcp + destination_port_range: 22 + access: Allow + priority: 1001 + direction: Inbound + - name: Create virtual network inteface card + azure_rm_networkinterface: + resource_group: "{{ resource_group }}" + name: "{{ vm_name }}" + virtual_network: "{{ vm_name }}" + subnet: "{{ vm_name }}" + public_ip_name: "{{ vm_name }}" + security_group: "{{ vm_name }}" + - name: Create VM + azure_rm_virtualmachine: + resource_group: "{{ resource_group }}" + name: "{{ vm_name }}" + vm_size: Standard_DS1_v2 + admin_username: azureuser + admin_password: Password@123 + network_interfaces: "{{ vm_name }}" + image: + offer: UbuntuServer + publisher: Canonical + sku: 16.04-LTS + version: latest \ No newline at end of file diff --git a/roles/install_demo/vars/main/infrastructure/chocolatey_app_install.yml b/roles/install_demo/vars/main/infrastructure/chocolatey_app_install.yml index c546d23..5e0d359 100644 --- a/roles/install_demo/vars/main/infrastructure/chocolatey_app_install.yml +++ b/roles/install_demo/vars/main/infrastructure/chocolatey_app_install.yml @@ -1,5 +1,5 @@ --- -chocolatey_config: +chocolatey_app_install: author: "David Rojas" readme: "https://github.com/ansible/product-demos/blob/master/docs/infrastructure/chocolatey_app_install.md" category: infrastructure