ppouliot.container_linux_azure
Ansible Role: container-linux-azure
This is an Ansible role for setting up multiple Container Linux instances on Azure.
Requirements
You need an Azure account with credentials, along with the Azure Client and Ansible with Azure support installed on your machine.
- Azure Credentials (in file: ~/.azure/credentials)
[default]
subscription_id=$AZURE_SUBSCRIPTION_ID
client_id=$AZURE_CLIENT_ID
secret=$AZURE_SECRET
tenant=$AZURE_TENANT
- Azure Credentials (as Environment Variables)
AZURE_CLIENT_ID=<YOUR_AZURE_CLIENT_ID>
AZURE_SECRET=<YOUR_AZURE_PASSWORD>
AZURE_SUBSCRIPTION_ID=<YOUR_AZURE_SUBSCRIPTION_ID>
AZURE_TENANT=<YOUR_AZURE_TENANT_ID>
Role Variables
You can adjust the following variables to fit your needs.
Virtual Machine Name Prefix
This is the starting part of the name for the virtual machine. The ending part will be based on a sequence number.
virtual_machine_naming_prefix: containerlinux
Create a new Azure Service Principle
Set this to true if you want to create a new service principle.
azure_create_new_service_principle: False
azure_service_principle_name: <NEW_SERVICE_PRINCIPLE_NAME>
Azure Install Dynamic Inventory
Use this option to download and set up the dynamic inventory script.
azure_install_dynamic_inventory: False
Azure Resource Group
This is the name you will give to your Azure Resource Group.
azure_rg: ContainerLinuxVMs
Azure Resource Group Location
Here you specify the location for the Azure Resource Group.
azure_rg_location: Eastus
Azure Resource Group Network Name
Name for the main network within the Azure resource group.
azure_rg_virt_net_name: ContainerLinuxVMsNetwork001
Azure Resource Group Network CIDR
This is the network address in CIDR format for your main network in Azure.
azure_rg_virt_net_cidr: "10.2.0.0/16"
Azure Resource Group Network Subnet Name
This is the name of the subnet within the main network.
azure_rg_virt_subnet_name: ContainerLinuxVMsSubNet001
Azure Resource Group Network Subnet Address
This is the network address in CIDR format for the subnet.
azure_rg_virt_subnet_addr: "10.2.1.0/24"
Azure Virtual Machine Size
Define how big the Azure virtual machine should be.
azure_vm_size: Standard_B1ms
Azure Managed Disk Type
Specify what type of managed disk you want for your Azure virtual machine.
azure_managed_disk_type: Premium_LRS
Azure Virtual Machines Total
This is the total number of Container Linux virtual machines you want to create.
azure_virtual_machines_total: 2
Container Linux Admin Password
Set a default password for the Core user.
container_linux_admin_password: Fl@tc@rL1nux
Container Linux SKU
Choose which Container Linux version to use on Azure: 'stable', 'beta', or 'alpha'. The default is 'alpha'.
container_linux_sku: 'alpha'
Container Linux Version
You can specify a version of Container Linux to use. The default is the latest version.
container_linux_version: latest
Example Playbook
Here is how you might typically use this role in an Ansible playbook.
- hosts: localhost
gather_facts: True
roles:
- container-linux-azure
Contributors
- Peter Pouliot peter@pouliot.net
Copyright and License
Copyright (C) 2018 Peter J. Pouliot
You can contact Peter Pouliot at: peter@pouliot.net
This software is licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License. A copy of the License can be found at:
http://www.apache.org/licenses/LICENSE-2.0
This software is provided "as is," without warranties or conditions of any kind. Please refer to the License for permissions and limitations.
Provision Container Linux (CoreOS) virtual machines on Azure
ansible-galaxy install ppouliot.container_linux_azure