-
Notifications
You must be signed in to change notification settings - Fork 0
/
F5-facts.yaml
41 lines (36 loc) · 1.72 KB
/
F5-facts.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Playbook to gather facts from the F5 load balancer
## bigip_device_info: tells the task which module to use. Everything except register is a module parameter defined on the module
## The gather_subset: system_info parameter tells the module only to grab system level information.
## The provider: parameter is a group of connection details for the Load Balancer
## The server: "private_ip" parameter tells the module to connect to the F5 IP address, which is a variable stored in inventory
## The user: "ansible_user" parameter tells the module the username to login to the F5 device with
## The password: "ansible_password" parameter tells the module the password to login to the F5 BIG-IP device with, variable in inventory
## The server_port: parameter tells the module the port to connect to the F5 device with
## The validate_certs: false parameter tells the module to not validate SSL certificates
## The register: device_facts tells the task to save the output to a variable bigip_device_info
---
- name: GRAB F5 FACTS
hosts: f5
connection: local
gather_facts: false
tasks:
- name: COLLECT BIG-IP FACTS
f5networks.f5_modules.bigip_device_info:
gather_subset:
- system-info
provider:
server: "{{private_ip}}"
user: "{{ansible_user}}"
password: "{{ansible_password}}"
server_port: 8443
validate_certs: false
register: device_facts
- name: DISPLAY COMPLETE BIG-IP SYSTEM INFORMATION
debug:
var: device_facts
- name: DISPLAY ONLY THE MAC ADDRESS
debug:
var: device_facts['system_info']['base_mac_address']
- name: DISPLAY ONLY THE VERSION
debug:
var: device_facts['system_info']['product_version']