Its been a while since I wrote my last blog post. All this COVID-19 stuff going on and also it was busy times. But finally, I got in a mood to write some short article 🙂
vRealize Automation 8.1 got a possibility to integrate Ansible out-of-the-box.
First of all we have to meet some of the pre-requisites:
1. Install Ansible. My favorite linux distribution is CentOS7
yum install ansible -y
2. Go to the /etc/ansible/ansible.cfg and uncomment the lines :
- host_key_checking = False
- vault_password_file = /path-to/vault-password
- ssh_args = -o UserKnownHostFile=/dev/null
3. Create vault pass file
At this part all our pre-reqs met and we can integrate vRA with Ansible.
1. Go to Cloud Assembly -> Infrastructure -> Integrations and choose Ansible
2. Fill in the forms validate and add.
3. Go to Design Tab and add the Ansible object connect it to the VM. In this example I have an input role which reflects the playbook and group in ansible:
4. And ofcourse within ansible we have to create the playbook itself i.e. for the Apache installation:
- name: This sets up an httpd webserver
- name: Install apache packages
- name: ensure httpd is running
- name: Open port 80 for http access
- name: Restart the firewalld service to load in the firewall changes
That is the nice and easy way to integrate Ansible with vRA.
Hope that it was informative. Enjoy your day!