F5 F5OS Ansible Collection

The F5 F5OS is the operating system for F5 VELOS and F5 rSeries. The VELOS platform is the next generation of F5’s industry-leading chassis-based systems, which deliver unprecedented performance and scalability in a single Application Delivery Controller (ADC). The next-generation Application Delivery Controller (ADC) solution, F5 rSeries, bridges the gap between traditional and modern infrastructures with a rearchitected, API-first platform designed to meet the needs of your traditional and emerging applications.

F5 VELOS and F5 rSeries rely on a Kubernetes-based platform layer (F5OS) that is tightly integrated with F5’s Traffic Management Operating System (TMOS) software, aligning with your modern architecture plans. This new microservices platform layer powers the next-generation of BIG-IP software, BIG-IP Next, which is built to offer greater automatability, scalability, and ease-of-use for organizations running applications on-premises, in the cloud, or at the edge.

F5OS Ansible collection for F5 VELOS and F5 rSeries helps in automating configuration and interaction with various services provided by F5 VELOS platform and F5 rSeries appliances.

For more information, see F5 VELOS and VELOS Overview or F5 rSeries and F5 rSeries Overview.

Version compatibility matrix

These F5OS versions are supported by these Ansible collection versions.

VELOS

VELOS F5OS F5 Ansible Declarative Collection
1.3.1 >= 1.0.0

rSeries

rSeries F5OS F5 Ansible Declarative Collection
1.2.0 >= 1.0.0

Supported Modules

F5OS collection 1.0.0 currently supports the following modules for F5OS based platforms.

Configurations

Module Name Description
velos_partition_image Upload/copy partition image on VELOS chassis
velos_partition Manage partitions on the VELOS chassis
velos_partition_wait Waits for the specified timeout value for the partition to match the desired state
velos_partition_change_password Manage password of a particular user on a partition
f5os_interface Configure properties related to physical interfaces on a partition * or appliance
f5os_lag Manage LAG interfaces - trunk/native vlans and physical interfaces to the LAG interfaces
f5os_vlan Manage VLANs on a partition or appliance
f5os_tenant_image Manage tenant images on a partition or appliance
f5os_tenant Manage F5OS tenant configuration
velos_tenant_wait Waits for a tenant to be in a desired running state

* This module should be used with partitions that have existing physical interfaces.


Using the F5OS collection

This example demonstrates using the F5OS collection to configure and deploy images in the VELOS platform.

Specifically:

  • Create a partition
  • Change a password on a partition
  • Configure the partition

Example velos_example.yaml

---
- name: Create Partition
  connection: httpapi
  hosts: velos-controller[0]
  collections:
    - f5networks.f5os
  any_errors_fatal: true

vars:
    ansible_user: "admin"
    ansible_httpapi_password: "password"   # VELOS Controller Password
    ansible_network_os: "f5networks.f5os.f5os"
    ansible_httpapi_use_ssl: true
    ansible_httpapi_use_proxy: false
    ansible_httpapi_validate_certs: "no"
    ansible_httpapi_port: 8888
    ansible_command_timeout: 1800
    persistent_log_messages: true
    partition_name: DemoPartition

tasks:
    - name: Create DEMO partition in running state
      velos_partition:
        name: "{{ partition_name }}"
        os_version: 1.3.1-5968
        ipv4_mgmt_address: 10.144.140.116/24
        ipv4_mgmt_gateway: 10.144.140.254
        slots: [2]
        state: enabled

    - name: Wait a maximum of 900 seconds for partition to reach running state.
      velos_partition_wait:
        name: "{{ partition_name }}"
        state: running
        timeout: 900

- name: Change Password on Partition
  connection: httpapi
  hosts: velos-partition[0]
  collections:
    - f5networks.f5os
  any_errors_fatal: true

vars:
    ansible_user: "admin"
    ansible_httpapi_password: "admin" # This is the default password for admin user on a partition
    ansible_network_os: "f5networks.f5os.f5os"
    ansible_httpapi_use_ssl: true
    ansible_httpapi_use_proxy: false
    ansible_httpapi_validate_certs: "no"
    ansible_httpapi_port: 8888
    ansible_command_timeout: 1800
    persistent_log_messages: true

tasks:
    - name: pause for 30 seconds
      pause:
        seconds: 30

    - name: Change password on Demo partition
      velos_partition_change_password:
        user_name: "admin"
        old_password: "old_password" # for the very first time this will probably be admin
        new_password: "new_password"


- name: Configure Partition
  connection: httpapi
  hosts: velos-partition[0]
  collections:
    - f5networks.f5os
  any_errors_fatal: true

tasks:
    - name: Attach Trunk-vlans to LAG to interface
      f5os_lag:
        name: "Olive"
        trunk_vlans: [1,2]
        state: present
        config_members:
        - '2/1.0'

    - name: Create multiple vlans on Demo partition
      f5os_vlan:
        name: "{{ item.name }}"
        vlan_id: "{{ item.id }}"
      with_items:
        - { name: 'Arista', id: '3' }
        - { name: 'Candor', id: '4' }

    - name: Associate VLANS with Interfaces
      f5os_interface:
        name: "2/2.0"
        trunk_vlans: [1,3]

    - name: Import tenant image onto the Velos partition
      f5os_tenant_image:
        image_name: "{{ image_name_1 }}"
        remote_host: "{{ server }}"
        remote_user: "{{ server_user }}"
        remote_password: "{{ server_pass }}"
        remote_path: "{{ image_path }}"
        protocol: "https"
        state: import

    - name: Check the status of the image import
      f5os_tenant_image:
        image_name: "{{ image_name_1 }}"
        timeout: 600
        state: present

    - name: Create DEMO tenant in running state
      f5os_tenant:
        name: "{{ tenant_1 }}"
        image_name: "{{ image_name_1 }}"
        nodes: "{{ nodes_2 }}"
        mgmt_ip: "{{ mgmt_ip_2 }}"
        mgmt_prefix: 24
        mgmt_gateway: "{{ mgmt_gw }}"
        vlans: "{{ vlans_1 }}"
        cpu_cores: "{{ cpu_2 }}"
        memory: "{{ mem_2 }}"
        running_state: "{{ state_2 }}"

    - name: Wait a maximum of 600 seconds for tenant to reach running state.
      f5os_tenant_wait:
        name: "{{ tenant_1 }}"
        state: "{{ state_2 }}"
        timeout: 600

The vars.yaml shows the configuration options we use in the velos_example.yaml file.

---
tenant_1: tenant1
image_name_1: "BIGIP-15.1.5-0.0.10.ALL-F5OS.qcow2.zip.bundle"
nodes_2: 2
mgmt_ip_2: <-IP-ADDR->
mgmt_gw: <-IP-ADDR->
state_2: deployed
mem_2: 12096
cpu_2: 2
vlans_1: [1]
image_path: "/v15.1.5/daily/build10.0/VM/"
server_user: "root"
server_pass: "XXXXXXXXX"
server: "example.f5velos.com"
...