-
Notifications
You must be signed in to change notification settings - Fork 0
/
provision-replication
executable file
·82 lines (75 loc) · 2.61 KB
/
provision-replication
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
#!/usr/bin/env ansible-playbook
# (c) 2018 DataNexus Inc. All Rights Reserved.
#
# main routine for provisioning confluent kafka
---
# complete preflight for all host groups
- name: CONFLUENT OVERLAY | completing preflight OS configuration
hosts: kafka_replicator
tags:
- confluent
vars_files:
- "{{ tenant_config_path }}/config/applications/confluent.yml"
vars:
# this is semi clever; application gets set based on each host group
application: "{{ group_names | first }}"
gather_facts: yes
tasks:
- include_role:
name: preflight
- name: CONFLUENT OVERLAY | installing confluent platform across all nodes
hosts: kafka_replicator
tags:
- confluent
vars_files:
- "{{ tenant_config_path }}/config/applications/confluent.yml"
gather_facts: yes
tasks:
- import_role:
name: confluent
vars:
confluent_platform_version: "confluent-platform-{{ scala_version }}"
# this is necessary before we build host groups from the ansible server because we need to discocer the public internal interface
- name: CONFLUENT OVERLAY | discovering kafka cluster facts
tags:
- confluent
hosts: kafka_broker_a:kafka_broker_b
tasks:
- setup:
- name: CONFLUENT OVERLAY | building broker clusters public internal host groups
tags:
- confluent
hosts: localhost
gather_facts: no
tasks:
- name: CONFLUENT OVERLAY | building broker cluster a public internal host group
add_host: hostname="{{ hostvars[item].ansible_eth1.ipv4.address }}" groupname=kafka_public_a
with_items: "{{ groups['kafka_broker_a'] }}"
when: "'kafka_broker_a' in groups | default([])"
- name: CONFLUENT OVERLAY | building broker cluster b public internal host group
add_host: hostname="{{ hostvars[item].ansible_eth1.ipv4.address }}" groupname=kafka_public_b
with_items: "{{ groups['kafka_broker_b'] }}"
when: "'kafka_broker_b' in groups | default([])"
- name: CONFLUENT OVERLAY | configuring confluent kafka connect replicator
hosts: kafka_replicator
tags:
- confluent
vars_files:
- "{{ tenant_config_path }}/config/applications/replicator.yml"
gather_facts: yes
tasks:
- import_role:
name: replicator
- name: CONFLUENT OVERLAY | completing postflight actions
hosts: kafka_replicator
tags:
- confluent
vars_files:
- "{{ tenant_config_path }}/config/applications/postflight.yml"
vars:
# this is semi clever; application gets set based on each host group
application: "{{ group_names | first }}"
gather_facts: no
tasks:
- include_role:
name: postflight