How to setup and configure your VMware Aria Automation environment to work with Ansible.
Use Case
I was recently asked how the VMware Aria Automation | Ansible Integration worked. I never used Ansible before so I thought this would be great time to learn Ansible and demo the integration with VMware Aria Automation. If you look at some of my previous blog posts I wrote about SaltStack Config a lot. I thought this would be a good time for myself to learn Ansible and compare the two products.
When I started reading about the VMware Aria Automation and Ansible Integration, I didn’t find a single blog post or article that covered everything from installing Ansible to creating a new Server Build in Aria Automation. I am going to document all the steps that it took for me to do a complete Aria Automation | Ansible integration. I hope that someone will find this blog post useful on their Automation journey.
A lot of people that write about Ansible use it with Red Hat Linux. For my demo environment, I chose to use Rocky Linux so that I don’t need to worry about any Red Hat licenses. Some people online recommend using Rocky Linux to replace CentOS. Sometimes it seems that the version of Linux you choose and what product to you use for Automation and Config management can be almost a religious debate. This blog post is to cover a specific use case. How to use VMware Aria Automation | Ansible Integration. Use whatever version of Linux you want. The details that I write about may need to be modified slightly if you use a different version of Linux. This blog post will at least give you the framework to get started.
When I wrote this Blog Post I was using VMware Aria Automation version 8.10.2, Ansible 2.13.3 and Rocky Linux 9.
To use the details in this blog post you will need a working install of VMware Aria Automation.
Create a Ansible Control Server and install Ansible:
Create a new Server. I created a clean Rocky Linux VM.
This server will be used as the Ansible Control Node.
Steps to install Ansible:
1
2
3
4
5
6
7
8
# Step 1 | Install Rocky Linux EPEL repositorydnf install epel-release -y
# Step 2 | Install Ansiblednf install ansible -y
# Check Ansible Version after Installansible --version
# the cmd at the cli to edit the ansible.cfg filenano /etc/ansible/ansible.cfg
This is the minium contents of the /etc/ansible/ansible.cfg file:
BOTH of these lines MUST be in the ansible.cfg file to add Ansible to VMware Aria Automation. If they are not present, adding the Integration will fail!
The vault password file can be named something different, BUT IT MUST BE SPECIFIED!
Creates a txt file, adds text to txt file, installs web server, starts web server service, enables cockpit, installs git, and does a git pull request from GitHub to copy web site files to new server.
# web-server-rocky.yml- hosts:rockyname:Ansible Playbook to Install Web Servertasks:- name:Create a new txt file | web-server.txtfile:path:/root/web-server.txtstate:touch- name:Add a line of text to txt file | web-server.txtlineinfile:path:/root/web-server.txtline:"vRA created this VM and used Ansible to create and modify this txt file | web-server.txt"- name:Install Apache web serverdnf:name:httpdstate:latest- name:Ensure HTTP server is runningservice:name:httpdstate:started- name:Run systemctl enable --now cockpit.socket commandshell:systemctl enable --now cockpit.socket- name:Install Gitdnf:name:gitstate:latest- name:Github Pull request of www.vCROCS.infoansible.builtin.git:repo:https://github.com/dalehassinger/Blog.gitdest:/var/www/htmlsingle_branch:yesversion:master
VMware Aria Automation Service Broker Catalog:
VMware Aria Automation Service Broker Request
You can make the Ansible Server Group and Playbooks a dropdown with the custom form. The code to do this is within the YAML code of the Cloud Template.
Lessons Learned
Lessons Learned:
The VMware Aria Automation | Ansible Integration works well if you follow all the configuration steps.
Ansible installation is very easy when you follow the directions.
Helpful Links
VMware Aria Automation | Ansible Links I found to be very helpful:
When I write about VMware Aria Automation I always say there are many ways to accomplish the same task. Ansible is the same way. I am showing what I felt was important to see but every organization/environment will be different. There is no right or wrong way to use Ansible.
If you found this Blog article useful and it helped you, Buy me a coffee to start my day.