-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.yml
46 lines (40 loc) · 1.23 KB
/
test.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
---
- name: Ensure Appropriate SSH Port
hosts: tuxlab-swarm-host
gather_facts: no
tasks:
- set_fact:
ansible_port: 2222
- name: Validate ETCD Cluster
hosts: all
tasks:
- name: Check ETCD Health
uri:
url: https://localhost:2379
client_cert: /etc/ssl/local/ca.pem
client_key: /etc/ssl/local/host.pem
return_content: true
register: result
failed_when: (result.json is not defined) or (!result.json.health)
- debug:
var: result.json
- name: Validate Docker Swarm
hosts: tuxlab-swarm-manager
tasks:
- name: Check Docker Swarm Health
uri:
url: https://localhost:4000/_ping
client_cert: /etc/ssl/local/ca.pem
client_key: /etc/ssl/local/host.pem
return_content: true
status_code: 200
- name: Validate Proxy is Running
hosts: tuxlab-swarm-host
tasks:
- name:
uri:
url: https://localhost:2376/v1.24/containers/host-proxy/json
client_cert: /etc/ssl/local/ca.pem
client_key: /etc/ssl/local/host.pem
return_content: true
failed_when: (result.json is not defined) or (!result.json.State.Running)