-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathcreate_vs.yml
64 lines (56 loc) · 1.6 KB
/
create_vs.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
---
- name: BIG-IP SETUP
hosts: lb
connection: local
gather_facts: false
collections:
- f5networks.f5_modules
tasks:
- name: Setting up provider values
set_fact:
provider:
server: "{{private_ip}}"
server_port: "8443"
validate_certs: "False"
- name: Setting up provider values
set_fact:
provider:
server: "{{ansible_host}}"
server_port: "{{server_port}}"
validate_certs: "False"
when: server_port is defined
- name: CREATE NODES
bigip_node:
provider: "{{provider}}"
host: "{{hostvars[item].private_ip}}"
name: "{{hostvars[item].inventory_hostname}}"
loop: "{{ groups['web'] }}"
- name: CREATE POOL
bigip_pool:
provider: "{{provider}}"
name: "http_pool"
lb_method: "round-robin"
monitors: "/Common/http"
monitor_type: "and_list"
- name: ADD POOL MEMBERS
bigip_pool_member:
provider: "{{provider}}"
state: "present"
name: "{{hostvars[item].inventory_hostname}}"
host: "{{hostvars[item].private_ip}}"
port: "80"
pool: "http_pool"
loop: "{{ groups['web'] }}"
- name: ADD VIRTUAL SERVER
bigip_virtual_server:
provider: "{{provider}}"
name: "vip"
destination: "{{private_ip}}"
port: "443"
enabled_vlans: "all"
all_profiles: ['http','clientssl','oneconnect']
pool: "http_pool"
snat: "Automap"
- name: PRINT OUT WEB VIP FOR F5
debug:
msg: "The VIP (Virtual IP) is https://{{private_ip}}"