-
Notifications
You must be signed in to change notification settings - Fork 2
/
le-cert-install-createenv.yml
87 lines (79 loc) · 2.32 KB
/
le-cert-install-createenv.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
---
- name: Cert Management on BIG-IP
hosts: lb
connection: local
gather_facts: false
vars:
F5_VIP_Name: testtest.gregsowell.com
files_loc: /opt/cert-store
provider:
server: changeMe
# user: admin
# password: supersecretPW
user: "{{ provider_user }}"
password: "{{ provider_pword }}"
server_port: 8443
validate_certs: "no"
tasks:
#Create Pool and Virtual Server for Use Case
- name: Create Pool with Members
bigip_pool:
provider: "{{provider}}"
state: present
name: "{{ F5_VIP_Name }}_pool"
lb_method: round-robin
monitors:
- http
- name: Add Pool Members
bigip_pool_member:
provider: "{{provider}}"
state: present
pool: "{{ F5_VIP_Name }}_pool"
name: "{{hostvars[item].inventory_hostname}}"
host: "{{hostvars[item].private_ip}}"
port: "80"
loop: "{{ groups['web'] }}"
- name: Create a HTTPS Virtual Server
bigip_virtual_server:
provider: "{{provider}}"
state: present
description: "HTTPS Virtual Server"
name: "{{ F5_VIP_Name }}_https_vip"
destination: "{{ private_ip }}"
port: "8081"
pool: "{{ F5_VIP_Name }}_pool"
snat: Automap
profiles:
- http
- oneconnect
- name: clientssl
context: client-side
when: F5_VIP_Name is defined
#SSL Upload and Modification of VIP to use New Certificate
- name: SSL cert upload
bigip_ssl_certificate:
provider: "{{provider}}"
name: "{{F5_VIP_Name}}_Cert"
content: "{{ lookup('file', files_loc + '/' + F5_VIP_Name + '.crt') }}"
- name: SSL key upload
bigip_ssl_key:
provider: "{{provider}}"
name: "{{F5_VIP_Name}}_Key"
content: "{{ lookup('file', files_loc + '/' + F5_VIP_Name + '.key') }}"
- name: Create a client SSL profile with a cert/key/chain setting
bigip_profile_client_ssl:
provider: "{{provider}}"
state: present
name: "{{F5_VIP_Name}}_ClientSSL_profile"
cert_key_chain:
- cert: "{{F5_VIP_Name}}_Cert"
key: "{{F5_VIP_Name}}_Key"
- name: UPDATE A VIRTUAL SERVER
bigip_virtual_server:
provider: "{{provider}}"
name: "{{ F5_VIP_Name }}_https_vip"
port: "8081"
profiles:
- name: "{{F5_VIP_Name}}_ClientSSL_profile"
context: client-side
- oneconnect