forked from cyverse-archive/de-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
verify-docker-service.yaml
49 lines (35 loc) · 1.71 KB
/
verify-docker-service.yaml
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
---
# Verifies that the docker service is setup correctly.
- name: Verify systemd docker.service setup
hosts: docker-ready
sudo: yes
gather_facts: false
tasks:
- name: docker.service BindsTo
shell: systemctl show -p BindsTo docker.service
register: docker_bindsto
- name: docker.service PartOf
shell: systemctl show -p PartOf docker.service
register: docker_partof
- name: docker.service After
shell: systemctl show -p After docker.service
register: docker_after
- name: docker.service Wants
shell: systemctl show -p Wants docker.service
register: docker_wants
- fail: msg="docker.service must be BindsTo network.service"
when: docker_bindsto.stdout.find('network.service') == -1
- fail: msg="docker.service must be BindsTo iptables.service"
when: docker_bindsto.stdout.find('iptables.service') == -1
- fail: msg="docker.service must be PartOf network.service"
when: docker_partof.stdout.find('network.service') == -1
- fail: msg="docker.service must be PartOf iptables.service"
when: docker_partof.stdout.find('iptables.service') == -1
- fail: msg="docker.service must start after network.service"
when: docker_after.stdout.find('network.service') == -1
- fail: msg="docker.service must start after iptables.service"
when: docker_after.stdout.find('iptables.service') == -1
- fail: msg="docker.service must start after network-online.target"
when: docker_after.stdout.find('network-online.target') == -1
- fail: msg="docker.service must want network-online.target"
when: docker_wants.stdout.find('network-online.target') == -1