Physical hardware Mutable Infrastructure Immutable Infrastructure planning to
Physical hardware
Mutable Infrastructure Immutable Infrastructure
% planning to deploy to multiple cloud 177 Explosion in multi-cloud OSS tools Dimensional Research study Gartner Study of Future of Datacenter in Cloud Era 191% of respondents planning to deploy to cloud 270% of enterprises to have multi cloud strategy by 2019
Provision Any Infrastructure For Any Application
Load balanc ers Netwo rk Datab ase Contai ners Web Apps Autom ation cdns DNS VMSS VMs Storag e … Traffic mgr Grid ACI Expre ssrou te Event s
What is Ansible? Modular Many built-in modules, or you can write your own Agent-less Your Ansible controller will connect to hosts to run the tasks SSH-based Connect to your hosts with SSH Keys (recommended), passwords, or Kerberos (Windows is supported)
SIMPLE POWERFUL AGENTLESS Human readable automation App deployment Agentless architecture No special coding skills needed Configuration management Uses Open. SSH & Win. RM Tasks executed in order Workflow orchestration No Agents to exploit or udpate Get productive quickly Orchestrate the app lifecycle More efficient and more secure
How Ansible Works CMDB PUBLIC / PRIVATE CLOUD ANSIBLE’S AUTOMATION ENGINE USERS ANSIBLE PLAYBOOK INVENTORY API MODULES PLUGINS HOSTS NETWORKING
Azure… via Ansible? Why? Use your favorite tooling? You shouldn’t have to worry about the “nooks and crannies” of Azure Immutable CI/CD One Ring to Rule Them All
Python Dependencies Install dependencies `pip install ansible[azure]` … or from source `pip install. [azure]` (root of the ansible git repository) But… what packages are these instead? Take a look! `pip freeze | grep azure` `cat packaging/requirements-azure. txt` (root of the ansible repo)
Authentication/Authorization Environment variables AZURE_CLIENT_ID AZURE_SECRET AZURE_SUBSCRIPTION_ID AZURE_TENANT Task parameters client_id secret subscription_id tenant Note: create the service principal through the Azure CLI (https: //aka. ms/Install. Azure. Cli) or from the Azure portal
Availability sets DNS Function App Load balancer Managed disk Network Public. IP Security Group Storage Virtual Machines Virtual Machine Scale Sets VNET …
https: //myignite. microsoft. com/evaluations https: //aka. ms/ignite. mobileapp
VM Provisioning – Creating the Resource Group - name: create a resource group azure_rm_resourcegroup: name: ansible-rg location: eastus
VM Provisioning – Creating the Virtual Network - name: create virtual network azure_rm_virtualnetwork: resource_group: ansible-rg name: ansiblevnet address_prefixes_cidr: - “ 11. 1. 0. 0/16”
VM Provisioning – Creating the Subnet - name: create subnet azure_rm_subnet: name: ansiblesubnet resource_group: ansible-rg virtual_network: ansiblevnet address_prefix_cidr: “ 11. 1. 0. 0/16”
VM Provisioning – Creating the Network Security Group - name: create nsg azure_rm_securitygroup: resource_group: ansible-rg name: ansiblefinalnsg rules: - name: allowssh protocol: Tcp destination_port_range: 22 access: Allow priority: 100 direction: Inbound
VM Provisioning – Creating the Public IP Address - name: create pip azure_rm_publicipaddress: name: ansiblepip resource_group: ansible-rg
VM Provisioning – Creating the Network Interface - name: create nic azure_rm_networkinterface: name: ansiblefinalnic resource_group: ansible-rg public_ip_address: ansiblepip subnet: ansiblesubnet virtual_network: ansiblevnet security_group: ansiblensg
VM Provisioning – Creating the Storage Account - name: create storage account azure_rm_storageaccount: name: ansiblestor resource_group: ansible-rg account_type: Standard_LRS
VM Provisioning – Retrieve your SSH Public Key - name: get ssh key command: cat ~/. ssh/id_rsa. pub register: sshkey
VM Provisioning – Create the Virtual Machine - name: create vm azure_rm_virtualmachine: resource_group: ansible-rg name: ansiblevm vm_size: Standard_D 1 storage_account: ansiblestor admin_username: admin. User ssh_password_enabled: false ssh_public_keys: - path: /home/admin. User/. ssh/authorized_keys key_data: '{{ sshkey. stdout }}' network_interfaces: ansiblenic image: offer: Cent. OS publisher: Open. Logic sku: '7. 3' version: latest
- Slides: 37