Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
code share

Automate F5 Initial Setup - iControl & Ansible

Problem this snippet solves:

While everyone loves F5, we all know the initial system setup, networking components and device service cluster is a tedious process. This simple Ansible playbook will allow you to automate the entire F5 initial setup by reading a CSV file and leave you with a ready to go active/standby pair.

This does include setting up - NTP, DNS, Hostname, LACP, dot1q, Self-IPs, device trust, configuration sync, etc

How to use this snippet:

How to Use

Required Items

  • Ansible (tested on version 2.1)
  • Blank pair of F5s with management IP configured (version 12.0 & 12.1)

Install Ansible if Needed

Official Ansible Install Guide

Great 3rd Party Install Guide

Download and Run F5 Ansible Setup Playbook - f5_ansible_setup.yml

Please run the following Ansible Playbook. This will download the required modules, playbook for F5 Initial Setup and example CSV file. Be sure to run this playbook from ~/ansible/playbooks/

F5 Ansible Setup Playbook

Fill Out CSV File - f5_initial_setup.csv

Use the example CSV file as an example to fit to your environment. Using the CSV file allows you to not have to edit the actual F5 Initial Setup Playbook. This was tested on a pair of 5200v's with so adjust interfaces as needed. The CSV file will be automatically downloaded from GitHub when you run the F5 Ansible Install Playbook.

Run F5 Initial Setup Playbook - f5_initial_setup.yml

Once you have edited the CSV file to your needs, run the F5 Initial Setup Playbook. This playbook will read the CSV file and configure the two F5 devices from scratch. When everything completes, you should be left with an active/standby pair of devices ready to go!

If you want to manually install the Ansible Playbook & Modules, please check out - GitHub

Tested on Version:
Comments on this Snippet
Comment made 01-Jul-2016 by BAGS 0
This is an outstanding solution. I give it 5 Stars!!!
Comment made 01-Jul-2016 by chrbrooks 0
Very nice! Awesome work here.
Comment made 01-Jul-2016 by Mark 29
Thanks! One key point here is that you do not have to understand or touch Ansible/programming to utilize this. Once the playbook is setup, all you need to be able to do is edit a CSV file for your particular needs.
Comment made 01-Jul-2016 by Joe Ploehn 0
Ansible makes this a powerful solution. I know I will use it!
Comment made 01-Jul-2016 by melikjay 0
As a deployment engineer who is not well versed with the F5 platform this is an awesome solution! I can easily stand up a new F5 and bring it up online without having to wait for an F5 savvy engineer to do so. I can have basic L2 & L3 functionality operational and verified saving time on our projects.
Comment made 01-Jul-2016 by RogerWhite 0
Nice work on the Automation.
Comment made 02-Jul-2016 by shawnwat 0
great work
Comment made 04-Jul-2016 by brianborland 0
Good Stuff
Comment made 05-Jul-2016 by JamesD
I have tried it out and it works really fast after you get a hang of it.
Comment made 06-Jul-2016 by Stooks 0
Nice job!
Comment made 12-Jul-2016 by Mark 29

Here is a quick video demo

F5 Ansible Initial Setup

Comment made 12-Dec-2017 by Aramnauth 0

Has anyone got this to work on F5 VE's?

Comment made 15-Jan-2018 by KernelPanic 169

What are the various software compatibility dependencies for getting ansible f5 to work?

Comment made 04-Jun-2018 by prt1969 177

Anything similar for deploying a new virtual server, pool, and nodes?

Comment made 3 weeks ago by Waqar 0

Can anyone share the playbook to add virtual servers, pools, nodes etc?