This Ansible role is designed to create a backup of the UCS (User Configuration Set) file from BIG-IP devices. It automatically handles all steps from initiating an API session to saving the UCS backup file on a utility server.
- Ansible version: 2.9 or higher
- Ansible
uri
module for API interactions - Ansible
assemble
module for file assembly delegate_to
functionality must be available for task delegation
- Control Node that can reach BIG-IP's API endpoint
- Utility server with NFS mount to store UCS files
- Python installed on the Ansible Control Node
This role requires the following variables to be defined:
big_ip_address
: The IP address of the BIG-IP device.bigip_username
: The username for the BIG-IP device.bigip_password
: The password for the BIG-IP device.tmp_dir
: Temporary directory to store UCS fragments on the control node.nfs_mount_point
: NFS mount point where the complete UCS file will be stored.chunk_size
: The size of each chunk during the file download (optional, default is set within the role).
- Get Current Time: Retrieves the current time to be used in naming the UCS file.
- Set Filename: Sets the filename for the UCS backup.
- Initiate BIG-IP API Session: Initializes a session with the BIG-IP API.
- Create UCS Backup: Generates the UCS file on the BIG-IP device.
- Create Directory for Fragments: Creates a directory to store file fragments.
- Fetch Initial Chunk of UCS: Downloads the first chunk of the UCS file.
- Download Remaining Chunks: Downloads the remaining chunks in parallel.
- Assemble File Parts: Assembles all downloaded fragments to form the complete UCS file.
- Move Assembled UCS: Moves the complete UCS file to a utility server.
- Clean Up: Removes temporary files and directories.
- Delete UCS from BIG-IP: Deletes the UCS file from the BIG-IP device post fetching.
Include this role in your Ansible Playbook:
- hosts: big_ip_servers
roles:
- name: your-role-name
Debug tasks are included within the role to help in troubleshooting. Look for lines starting with === IMPORTANT ===
and === ALERT ===
in the Ansible output for important messages.
MIT
Contributions are welcome. Please submit pull requests for any enhancements.
Kyle Jones