Azure Automation With AWX ( Ansible Tower Upstream Project )

ကျွန်တော် sharing လုပ်ချင်တာက Microsoft Azure Cloud ကို AWX ( Ansible Tower Upstream project) ကိုသုံးပြီး ဘယ်လို Manage လုပ်မလဲကို sharing လုပ်ချင်ပါတယ်.

အရင်ဆုံး ကျွန်တော်တို့ High Level Design ( HLD ) ကို ကြည့်ရအောင်.

*Prerequisites*

  • Linux host for AWX or Ansible Tower Installation
  • Microsoft Azure Account
  • Azure Subscription, Tenant, and Service Principals
  • git account
  • Microsoft VSCode or IDE
  • AWX Inventory, Credentials, Projects, and Templates Usage

*Linux host for AWX or Ansible Tower Installation*

ကျွန်တော်တို့ Linux host အတွက် Redhat or Debian ကြိုက်တာ သုံးလို့ရပါတယ်.

on-premises or cloud ပေါ်မှာ Install လုပ်လို့ရပါတယ်.

https://github.com/ansible/awx

ကျွန်တော်က kvm (virtualization) ပေါ်မှာ deploy လုပ်ထားပါတယ်, ကိုယ်ကြိုက်တဲ့ virtualization ကိုသုံးလို့ရပါတယ်.

*Microsoft Azure Account*

အရင်ဆုံး ကျွန်တော်တို့ Microsoft Account တစ်ခုကို တည်ဆောက်ပါ.

https://account.microsoft.com

ဒါမှမဟုတ် Azure Student Account တစ်ခုကို တည်ဆောက်ပါ.

https://azure.microsoft.com/en-us/free/students/

ကျွန်တော်က Azure Student Account ကိုသုံးထားပါတယ်.

*Azure Tenant ID and service principals*

ကျွန်တော် Azure Cloud Shell ကို သုံးထားပါတယ်.

azure powershell ကိုသုံးပြီး azure subscription_id, client_id, tenant_id, secret ကို ထုတ်ပါ.

Azure Service Principal account ကို create လုပ်ပြီး Role attach လုပ်ပါ.

*Azure Service Principal Account*

Azure Service Principal Account ကို GUI or Azure Powershell နဲ့ create လုပ်လို့ရပါတယ်.

#For GUI

https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal

#For Azure Powershell

https://dev.to/cloudskills/connecting-to-azure-with-ansible-22g2

*Azure Credentials*

Azure Credentials ကို Azure Cloud Shell မှာ မှတ်ထားပါ.

*Git Account*

Microsoft Azure ကို AWX မှာ Automation ( IaC or CAC ) နဲ့ manage လုပ်ဖို့ git account တစ်ခု လိုအပ်ပါတယ်.

https://github.com/

*Microsoft VSCode or IDE*

Ansible playbook ရေးဖို့နဲ့ github ပေါ်တင်ထားတဲ့ project တွေကို manage လုပ်ဖို့ ပါ.

*AWX Installation*

AWX ကို CentOS or Ubuntu ပေါ်မှာ Deploy လုပ်ပြီးရင် ကျွန်တော်တို့ လိုအပ်တဲ့ inventory, credentials, projects တို့ကို create လုပ်ရပါမယ်.

ကျွန်တော်က AWX ကို CentOS 8 ပေါ်မှာ Docker နဲ့ Install လုပ်ထားပါတယ်. AWX က Ansible Tower ရဲ့ upstream project ဖြစ်လို့ Ansible Tower နဲ့ စမ်းရင်လဲရပါတယ်.

AWX Latest Version ကို minikube ပေါ်မှာ လဲ deploy လုပ်ထားပါတယ်.

#For Ansible Tower

https://docs.ansible.com/ansible-tower/latest/html/quickinstall/index.html#

https://ansible.github.io/workshops/exercises/ansible_f5/4.0-explore-tower/

#For AWX

https://github.com/ansible/awx

*AWX*

AWX UI ကိုကြိုက်ရာ browser သုံးပြီး login ဝင်ပါ.

*Azure Automation*

Microsoft Azure ကို Automation နဲ့ manage လုပ်ဖို့ လိုအပ်တဲ့ Inventory, project, credentials and templates ကို AWX မှာ create လုပ်ပါ.

#Inventory

#credentials

ကျွန်တော်တို့ Azure Cloud Shell မှာ သိမ်းထားတဲ့ azure credentials ကို အောက်ပါအတိုင်း ဖြည့်ပါ.

#projects

ကျွန်တော်က project အတွက် git ကိုသုံးထားပါတယ်.

azure sample project

https://github.com/Htunn/azure_ansible

*Templates*

Microsoft Azure ကို Automation နဲ့ manage လုပ်ဖို့ templates တစ်ခု create လုပ်ပါ.

ကျွန်တော်တို့ azure portal မှာ check လုပ်လို့ရပါတယ်.

Ansible and Ansible Tower ကိုဆက်လေ့လာလိုလျှင်.

https://ansible.github.io/workshops/

https://www.ansiblefordevops.com/

“Thanks For Your Time, Mate”

Leave a Reply

Your email address will not be published. Required fields are marked *