-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathF5file_build.yml
117 lines (107 loc) · 3.54 KB
/
F5file_build.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
- name: Create a node, pool and VIP and take the node out of circulation
hosts: "{{ hosts }}"
connection: local
tasks:
- name: Get all of the facts from my BIG-IP
bigip_facts:
server: "{{ inventory_hostname }}"
user: "{{username}}"
password: "{{password}}"
include: "system_info,software,self_ip"
validate_certs: "false"
- name: Mention the software
debug:
msg: "I have software version {{ software[0].version }}"
- name: Add a new node generic webhost 01
bigip_node:
server: "{{ inventory_hostname }}"
user: "{{username}}"
password: "{{password}}"
host: "10.0.2.167"
name: "member1"
validate_certs: "false"
state: "present"
monitors:
- /Common/icmp
- name: Add a new node generic webhost 02
bigip_node:
server: "{{ inventory_hostname }}"
user: "{{username}}"
password: "{{password}}"
host: "10.0.2.168"
name: "member2"
validate_certs: "false"
state: "present"
monitors:
- /Common/icmp
- name: Create the gw_pool pool
bigip_pool:
server: "{{ inventory_hostname }}"
user: "{{username}}"
password: "{{password}}"
name: "pool1"
validate_certs: "false"
monitors:
- /Common/http_head_f5
- name: Add members into gw_pool
bigip_pool_member:
server: "{{ inventory_hostname }}"
user: "{{username}}"
password: "{{password}}"
state: "present"
host: "{{ item }}"
pool: "pool1"
port: "8080"
validate_certs: "false"
with_items:
- member1
- member2
- name: Add the iRule contained in the static file irule-sorry.tcl to the LTM module
bigip_irule:
module: "ltm"
server: "{{ inventory_hostname }}"
user: "{{username}}"
password: "{{password}}"
name: "Sorry_iRule"
src: "irule-sorry.tcl"
validate_certs: "no"
- name: Add the iRule contained in the static file bodgeit-rewrite.tcl to the LTM module
bigip_irule:
module: "ltm"
server: "{{ inventory_hostname }}"
user: "{{username}}"
password: "{{password}}"
name: "Bodgeit_Rewrite"
src: "bodgeit-rewrite.tcl"
validate_certs: "no"
- name: Create a VIP
bigip_virtual_server:
server: "{{ inventory_hostname }}"
description: "generic web VIP"
destination: "10.0.2.183"
user: "{{username}}"
password: "{{password}}"
name: "vip-1"
pool: "pool1"
port: "80"
snat: "Automap"
all_profiles:
- "http"
all_rules:
- "Sorry_iRule"
- "Bodgeit_Rewrite"
validate_certs: "no"
- name: Drop members out of pool1
bigip_pool_member:
server: "{{ inventory_hostname }}"
user: "{{username}}"
password: "{{password}}"
state: "present"
session_state: "disabled"
host: "{{ item }}"
pool: "pool1"
port: "8080"
validate_certs: "false"
with_items:
- member1
- member2