Management of F5 via Ansible complete process adding a host defining the variables and testing it-Part1
Well for the first time I had interaction with Ansible back in 2017 at that time I did't knew how to spell it properly, Thanks to Google it gives me result by guessing it. In between I didn't use ansible at all till now. This time I need to use ansible for the automation of operations task on F5 and other network devices. I have started by installing the ansible on my virtual machine and enable SSH communication in between them. Further below mentioned are the steps for deploying ansible and then doing other setting for the first playbook to be run on F5.
Installation of Ansible
For different Linux flavors we do have different commands you can search it over the internet as per your requirements
yum -y install ansible
ansible --version
ansible 2.9.25
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /bin/ansible
python version = 2.7.5
Now as ansible is install and we can see the version of it, we can move forward before going to next step make sure your working directory for ansible is /etc/ansible there will be default hosts file in this directory.
you can check it by doing ls in directory /etc/ansible
I will create another inventory file (hosts file) and will use it to define the F5 host which need to be managed via ansible.
nano inventory
You will be prompt with a black screen, and you need to define the host group and IP into it.
[F5]
192.168.1.100
We have added a F5 node in our ansible inventory file we can verify it.
ansible-inventory -i inventory --list
{
"F5": {
"hosts": [
"192.168.1.100"
]
},
"_meta": {
"hostvars": {}
},
"all": {
"children": [
"F5",
"ungrouped"
]
}
}
So till now we have setup the connectivity between ansible host and F5, please make sure to allow SSH source IP at F5 end for the machine form where you will run the ansible playbooks.
Now all done for the connectivity let try to see we have a connectivity between host and ansible machine via ansible.
I will continue working on playbook writing for the tasks and will share my experience in coming posts before that i guess have to learn YAML for writing playbooks.
Raja Shajeel Ahmad
Enterprise DC Engineer
Happy Learning
The limit is the sky.
Comments