For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Upgrade BigIP using Ansible

Problem this snippet solves:

A simple, and possibly poor, ansible playbook for upgrading devices.

Allows separating devices into two "reboot groups" to allow rolling restarts of clusters.

How to use this snippet:

Clone or download the repository.

Update the hosts.ini inventory file to your requirements

Run ansible-playbook -i hosts.ini upgrade.yaml

The script will identify a boot location to use from the first two on your big-ip system, will upload and install the image, and will then activate the boot location for each "reboot group" sequentially.

Tested this on version:

No Version Found
Published Jul 11, 2020
Version 1.0

4 Comments

  • great script.. i wrote something similar..

     

    the only thing i added cpcfg to copy the config from HD1.1 to HD1.2

     

    - name: Copy the config from HD1.1 to HD1.2 cpcfg --source=HD1.1 --reboot HD1.2 raw: curl -u "{{ansible_user}}":"{{ansible_ssh_pass}}" -k https://"{{ansible_host}}":8443/mgmt/tm/util/bash -H "Content-type:application/json" -d "{\"command\":\"run\",\"utilCmdArgs\":\"-c 'cpcfg --source=HD1.1 --reboot HD1.2'\"}"ignore_errors: Trueregister: cpcfg

     

     

  • Thanks Sebastian, and kudos for the presentation on DevCentral Connect. It was when watching a previous video and they mentioned you'd automated it that I thought "I could do that".

     

    I haven't found myself needing to have a task to copy the config. I've tested it (in a VE lab) with new boot locations and it looks as though the copy config is implicit in the bigip_software_install task. Have you had experience of it not copying the config over?

  • This is a great playbook, but I am having an issue. When upgrading from version 13.1.3.0.0.6 to version 14.1.2.5.0.0.3 I'm getting and error message Failed to create the resource on the upload task. I have confirmed the version is available for download and I have space on the F5. Not sure where to go from here??

  • I should have also included that the playbook works great when going from 12.1.3.0.0.378 to 13.1.3.0.0.6. I'm using Ansible 2.9