ကျွန်တော် sharing လုပ်ချင်တာ VMWare ESXi or vCenter ကို AWX ( Ansible Tower ) သုံးပြီး Automation ( Iac & CAC ) နဲ့ဘယ်လို manage လုပ်ရမလဲကို sharing လုပ်ချင်ပါတယ်.
အရင်ဆုံး ကျွန်တော်တို့ High Level Design ကိုကြည့်ရအောင်.
*Prerequisites*
- Linux Host ( On-premise or Cloud )
- VMWare vCenter or ESXi
- Git Account
- Microsoft VSCode or IDE
- AWX Installation
- 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 ကိုသုံးလို့ရပါတယ်.
*VMWare vCenter or ESXi*
ကျွန်တော်က VMWare ESXi 6.7 ကို သုံးထားပါတယ်.
SSH Service ကို ESXi Web UI or Console မှာ ဖွင့်ပေးပါ.
#From Web UI
#From Console
SSH Access ကို Test လုပ်ပါ.
SSH Password မလိုဘဲ Access လုပ်ဖို့ အောက်ပါ absolute path မှာ public key ကို သွားသိမ်းပါ.
% cat ~/.ssh/id_rsa.pub | ssh root@esxi6-7 ‘cat >> /etc/ssh/keys- root/authorized_keys’
SCP သုံးလဲရပါတယ်.
*VMWare ESXi License Key for API Access*
vSphere Automation API Access လုပ်ဖို့ license လိုပါတယ်.
*VMware vSphere ESXi 7.0 Enterprise Plus key*
JJ2WR-25L9P-H71A8-6J20P-C0K3F
HN2X0-0DH5M-M78Q1-780HH-CN214
JH09A-2YL84-M7EC8-FL0K2-3N2J2
vSphere Automation API နဲ့ Ansible connection ကို SSL နဲ့ သုံးချင်ရင် အောက်ပါ link မှာကြည့်ပါ.
https://docs.ansible.com/ansible/latest/scenario_guides/vmware_scenarios/vmware_requirements.html
*Git Account*
VMWare ကို AWX မှာ Automation ( IaC or CAC ) နဲ့ manage လုပ်ဖို့ git account တစ်ခု လိုအပ်ပါတယ်.
*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 ဝင်ပါ.
*AWX Inventory, Credentials, Projects, Inventory ,and Templates Usage*
VMWare ကို Automation နဲ့ manage လုပ်ဖို့ လိုအပ်တဲ့ Inventory, project, credentials and templates ကို AWX မှာ create လုပ်ပါ.
#Inventory
#credentials
AWX ရဲ့ SSH Private Key ကို Credentials မှာ ထည့်ပါ.
#projects
ကျွန်တော်က project အတွက် git ကိုသုံးထားပါတယ်.
# Ansible VMWare Sample Project
https://github.com/Htunn/Ansible_VMWare.git
*Templates*
VMWare ကို Automation နဲ့ manage လုပ်ဖို့ templates တစ်ခု create လုပ်ပါ.
ကျွန်တော် sample playbook ကို run ကြည့်ရအောင်.
ကျွန်တော်တို့ VMWare ESXi UI မှာ check လို့ရပါတယ်.
Ansible and Ansible Tower ကိုဆက်လေ့လာလိုလျှင်.
https://ansible.github.io/workshops/
https://www.ansiblefordevops.com/
“Thanks For Your Time, Mate”