-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathf5-config2.yml
99 lines (96 loc) · 2.89 KB
/
f5-config2.yml
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
- name: Base VE config
hosts: "{{ target_hosts | default('f5') }}"
connection: local
gather_facts: False
vars:
bigip_provider:
server: 10.1.1.245
user: admin
password: admin
validate_certs: no
tasks:
- name: Create pool
bigip_pool:
state: present
name: "{{ item.name }}"
partition: Common
lb_method: "{{ item.lb_method }}"
monitors:
- http
provider: "{{ bigip_provider }}"
with_items:
- name: pool1
lb_method: round-robin
- name: pool2
lb_method: round-robin
- name: pool3
lb_method: round-robin
delegate_to: localhost
- name: Add pool member
bigip_pool_member:
state: present
pool: "{{ item.bigip_pool }}"
partition: Common
host: "{{ item.bigip_pool_member }}"
port: "{{ item.bigip_pool_member_port }}"
provider: "{{ bigip_provider }}"
delegate_to: localhost
with_items:
- bigip_pool: pool1
bigip_pool_member: 1.1.1.1
bigip_pool_member_port: 80
- bigip_pool: pool1
bigip_pool_member: 1.1.1.2
bigip_pool_member_port: 80
- bigip_pool: pool1
bigip_pool_member: 1.1.1.3
bigip_pool_member_port: 80
- bigip_pool: pool2
bigip_pool_member: 2.2.2.1
bigip_pool_member_port: 80
- bigip_pool: pool2
bigip_pool_member: 2.2.2.2
bigip_pool_member_port: 80
- bigip_pool: pool2
bigip_pool_member: 2.2.2.3
bigip_pool_member_port: 80
- bigip_pool: pool3
bigip_pool_member: 3.3.3.1
bigip_pool_member_port: 80
- bigip_pool: pool3
bigip_pool_member: 3.3.3.2
bigip_pool_member_port: 80
- bigip_pool: pool3
bigip_pool_member: 3.3.3.3
bigip_pool_member_port: 80
- name: Add virtual server
bigip_virtual_server:
state: present
partition: Common
name: "{{ item.bigip_virtual_name }}"
destination: "{{ item.bigip_virtual_destination }}"
port: "{{ item.bigip_vip_port }}"
pool: "{{ item.bigip_pool }}"
snat: "{{ item.bigip_virtual_snat_type }}"
description: "{{ item.bigip_virtual_description }}"
provider: "{{ bigip_provider }}"
delegate_to: localhost
with_items:
- bigip_virtual_name: virt1
bigip_virtual_destination: 100.1.1.1
bigip_vip_port: 80
bigip_pool: pool1
bigip_virtual_snat_type: automap
bigip_virtual_description: "Test VIP"
- bigip_virtual_name: virt2
bigip_virtual_destination: 200.1.1.1
bigip_vip_port: 80
bigip_pool: pool2
bigip_virtual_snat_type: automap
bigip_virtual_description: "Test VIP 2"
- bigip_virtual_name: virt3
bigip_virtual_destination: 233.1.1.1
bigip_vip_port: 80
bigip_pool: pool2
bigip_virtual_snat_type: automap
bigip_virtual_description: "Test VIP 3"