aboutsummaryrefslogtreecommitdiffstats
path: root/kube2consul/src/main/blueprint/task.yml
blob: 45cfcd9b0d1967895a8e6fc969b229b20c530b1a (plain)
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
118
---
- name: remove kube2consul container
  docker:
    name: kube2consul
    image: "{{kube2consul_image}}"
    state: absent 

- name: run kube2consul container
  docker:
    name: kube2consul
    image: "{{kube2consul_image}}"
    log_driver: syslog
    net: host
    restart_policy: always
    volumes:
    - "{{ kube2consul_data_host }}:{{ kube2consul_data_container }}"
    env:
      KUBE_MASTER_IP: "{{kube_master_ip}}"
      PDM_CONTROLLER_IP: "{{pdm_controller_ip}}"
      JOIN_IP: "{{consul_join_ip}}"
  when:
    - all_in_one == 'no'
    - master_in_controller == 'no'
    - cluster_type == 'k8s'

- name: run kube2consul container
  docker:
    name: kube2consul
    image: "{{kube2consul_image}}"
    net: host
    restart_policy: always
    privileged: true
    volumes:
    - "{{ kube2consul_data_host }}:{{ kube2consul_data_container }}"
    - "/root/.kube/config:/root/.kube/config:ro"
    env:
      KUBE_MASTER_IP: "{{kube_master_ip}}"
      PDM_CONTROLLER_IP: "{{pdm_controller_ip}}"
      JOIN_IP: "{{consul_join_ip}}"
      CLUSTER_TYPE: "openshift"
  when:
    - all_in_one == 'no'
    - master_in_controller == 'no'
    - cluster_type == 'openshift'

- name: run kube2consul container
  docker:
    name: kube2consul
    image: "{{kube2consul_image}}"
    log_driver: syslog
    restart_policy: always
    volumes:
    - "{{ kube2consul_data_host }}:{{ kube2consul_data_container }}"
    env:
      KUBE_MASTER_IP: "{{kube_master_ip}}"
      PDM_CONTROLLER_IP: "{{pdm_controller_ip}}"
      JOIN_IP: "{{consul_join_ip}}"
      ALL_IN_ONE: "yes"
  when:
    - all_in_one == 'yes'
    - cluster_type == 'k8s'

- name: run kube2consul container
  docker:
    name: kube2consul
    image: "{{kube2consul_image}}"
    log_driver: syslog
    restart_policy: always
    privileged: true
    volumes:
    - "{{ kube2consul_data_host }}:{{ kube2consul_data_container }}"
    - "/root/.kube/config:/root/.kube/config:ro"
    env:
      KUBE_MASTER_IP: "{{kube_master_ip}}"
      PDM_CONTROLLER_IP: "{{pdm_controller_ip}}"
      JOIN_IP: "{{consul_join_ip}}"
      ALL_IN_ONE: "yes"
      CLUSTER_TYPE: "openshift"
  when:
    - all_in_one == 'yes'
    - cluster_type == 'openshift'

- name: run kube2consul container
  docker:
    name: kube2consul
    image: "{{kube2consul_image}}"
    log_driver: syslog
    restart_policy: always
    volumes:
    - "{{ kube2consul_data_host }}:{{ kube2consul_data_container }}"
    env:
      KUBE_MASTER_IP: "{{kube_master_ip}}"
      PDM_CONTROLLER_IP: "{{pdm_controller_ip}}"
      JOIN_IP: "{{consul_join_ip}}"
      ALL_IN_ONE: "yes"
  when:
    - master_in_controller == 'yes'
    - cluster_type == 'k8s'

- name: run kube2consul container
  docker:
    name: kube2consul
    image: "{{kube2consul_image}}"
    log_driver: syslog
    restart_policy: always
    privileged: true
    volumes:
    - "{{ kube2consul_data_host }}:{{ kube2consul_data_container }}"
    - "/root/.kube/config:/root/.kube/config:ro"
    env:
      KUBE_MASTER_IP: "{{kube_master_ip}}"
      PDM_CONTROLLER_IP: "{{pdm_controller_ip}}"
      JOIN_IP: "{{consul_join_ip}}"
      ALL_IN_ONE: "yes"
      CLUSTER_TYPE: "openshift"
  when:
    - master_in_controller == 'yes'
    - cluster_type == 'openshift'