Exercise 1.7: Using the bigip_config module

Objective

Demonstrate use of the BIG-IP config module to save the running configuration to disk

Guide

Step 1:

Examine the bigip-config.yml in the VSCode editor. Expand in the Explorer (f5-bd-ansible-labs –> 101-F5-Basics –> 1.7-save-running-config):

Examine the Code

  • name: SAVE RUNNING CONFIG ON BIG-IP is a user defined description that will display in the terminal output.

  • The bigip_config: is the module saving the running configuration to the startup configuration on the BIG-IP.

  • The provider: parameter is a group of connection details for the BIG-IP.

    • The server: "{{ ansible_host }}" parameter tells the module to connect to the F5 BIG-IP IP address, which is stored as a variable ansible_host in inventory

    • The user: "{{ ansible_user }}" parameter tells the module the username to login to the F5 BIG-IP device with

    • The password: "{{ ansible_password }}" parameter tells the module the password to login to the F5 BIG-IP device with

    • The server_port: "{{ server_port }} parameter tells the module the port to connect to the F5 BIG-IP device with

    • The validate_certs: false parameter tells the module to not validate SSL certificates. This is just used for demonstration purposes since this is a lab.

  • The save: "yes"" parameter tells the module to save the running-config to startup-config. This operation is performed after any changes are made to the current running config. If no changes are made, the configuration is still saved to the startup config. This option will always cause the module to return changed Save File.

Step 2:

Change directories to the exercise 1.7 folder to examine and execute the code in the Terminal

cd ~/f5-bd-ansible-labs/101-F5-Basics/1.7-save-running-config/

Step 3:

Run the playbook - Go back to the Terminal on VS Code server on the control host and execute the following:

ansible-navigator run bigip-config.yml --mode stdout

Playbook Output

The output will look as follows.

[rhel-user@ede... 1.7-save-running-config]$  ansible-navigator run bigip-config.yml --mode stdout

PLAY [BIG-IP SETUP] ************************************************************

TASK [SAVE RUNNING CONFIG ON BIG-IP] *******************************************
changed: [f5]

PLAY RECAP *********************************************************************
f5                         : ok=1    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

Solution

The finished Ansible Playbook is provided here. Click here: bigip-config.yml.

You have finished this exercise.