Skip to content
This repository was archived by the owner on Jul 17, 2024. It is now read-only.

Commit 634807c

Browse files
author
Ramon
committed
v0.2 updated after integration meeting
1 parent b113a8e commit 634807c

File tree

4 files changed

+95
-7
lines changed

4 files changed

+95
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ In this Ansible project, there are some configuration files that must be complet
4242

4343
* **hosts:** here, you have to include the DCM server which will be configured within this Ansible project. The format of each line (PLEASE FOLLOW THIS FORMAT) should be the following: *dcm_hostname ansible_host=<DCM_IP> ansible_user=<USER> ansible_ssh_pass=<SSH_PASS> ansible_become_pass=<SUDO_PASS>*
4444
* **group_vars:** includes useful variables for the servers defined in the *hosts* file.
45-
* **all:** applies to all servers. Nothing to change here at the beginning. Only if you want to be stopped with each Ansible role execution, set *prompt_when_finishes_tasks* to true, or false otherwise. Other variables that may require a change are *kafka_version*, which must be set to the Kafka version to be used, *update_module*, which specifies if it is an update (true) or an installation from scratch (false), *site*, which specifies the location of the server to be updated, choosing between the following values: iwl (default), spain, italy, france and greece, *kafka_topics_script_route*, which specifies, for the site brokers, the route in which the kafka-topics.sh script is located, *{spanish|italian|french|greek}_site_ip_port*, which contains the IP:Kafka port in the site broker, *{spanish|italian|french|greek}_plugin_ip_port*, which contains the IP:plugin port in the site broker, and *{spanish|italian|french|greek}_plugin_port*, which only specifies the plugin port.
45+
* **all:** applies to all servers. Nothing to change here at the beginning. Only if you want to be stopped with each Ansible role execution, set *prompt_when_finishes_tasks* to true, or false otherwise. Other variables that may require a change are *kafka_version*, which must be set to the Kafka version to be used, *update_module*, which specifies if it is an update (true) or an installation from scratch (false), *site*, which specifies the location of the server to be updated, choosing between the following values: iwl (default), spain, italy, france and greece, *kafka_topics_script_route*, which specifies, for the site brokers, the route in which the kafka-topics.sh script is located, *{spanish|italian|french|greek}_site_ip_port*, which contains the IP:Kafka port in the site broker (must be the one in the VPN), *{spanish|italian|french|greek}_plugin_ip_port*, which contains the IP:plugin port in the site broker (must be the one in the VPN), *{spanish|italian|french|greek}_plugin_port*, which only specifies the plugin port, and *{spanish|italian|french|greek}_vpn_ip*, which refers to the IP address used for each Kafka brokers in the VPN.
4646

4747
### 5. Download 5geve-wp3-dcm-handler repository from Github (only if Kafka broker is the one from IWL)
4848

group_vars/all

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,19 @@ kafka_version: 2.5.0
66
update_module: true
77
site: iwl # options: iwl, spain, italy, france, greece
88
kafka_topics_script_route: /opt/kafka/bin/kafka-topics.sh
9-
spanish_site_ip_port: 10.7.0.21:9092
9+
spanish_site_ip_port: 127.0.0.1:9092
1010
italian_site_ip_port: 127.0.0.1:9092
1111
french_site_ip_port: 127.0.0.1:9092
1212
greek_site_ip_port: 127.0.0.1:9092
13-
spanish_plugin_ip_port: 10.7.0.21:8090
13+
spanish_plugin_ip_port: 127.0.0.1:8090
1414
italian_plugin_ip_port: 127.0.0.1:8090
1515
french_plugin_ip_port: 127.0.0.1:8090
1616
greek_plugin_ip_port: 127.0.0.1:8090
1717
spanish_plugin_port: 8090
1818
italian_plugin_port: 8090
1919
french_plugin_port: 8090
2020
greek_plugin_port: 8090
21+
spanish_vpn_ip: 127.0.0.1
22+
italian_vpn_ip: 127.0.0.1
23+
french_vpn_ip: 127.0.0.1
24+
greek_vpn_ip: 127.0.0.1

roles/preparation/tasks/main.yml

Lines changed: 86 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,12 +236,40 @@
236236
line: 'listeners=PLAINTEXT://0.0.0.0:9092'
237237
when: not update_module
238238

239-
- name: Include advertised listener for the Kafka Socket Server Settings
239+
- name: Include advertised listener for the Kafka Socket Server Settings (IWL)
240240
lineinfile:
241241
path: /opt/kafka/config/server.properties
242242
regexp: '#advertised.listeners=PLAINTEXT://your.host.name:9092'
243243
line: "advertised.listeners=PLAINTEXT://{{ansible_host}}:9092"
244-
when: not update_module
244+
when: not update_module and site == "iwl"
245+
246+
- name: Include advertised listener for the Kafka Socket Server Settings (Spain)
247+
lineinfile:
248+
path: /opt/kafka/config/server.properties
249+
regexp: '#advertised.listeners=PLAINTEXT://your.host.name:9092'
250+
line: "advertised.listeners=PLAINTEXT://kafka.spain.iwl:9092"
251+
when: not update_module and site == "spain"
252+
253+
- name: Include advertised listener for the Kafka Socket Server Settings (Italy)
254+
lineinfile:
255+
path: /opt/kafka/config/server.properties
256+
regexp: '#advertised.listeners=PLAINTEXT://your.host.name:9092'
257+
line: "advertised.listeners=PLAINTEXT://kafka-polito:9092"
258+
when: not update_module and site == "italy"
259+
260+
- name: Include advertised listener for the Kafka Socket Server Settings (France)
261+
lineinfile:
262+
path: /opt/kafka/config/server.properties
263+
regexp: '#advertised.listeners=PLAINTEXT://your.host.name:9092'
264+
line: "advertised.listeners=PLAINTEXT://kafka.france.iwl:9092"
265+
when: not update_module and site == "france"
266+
267+
- name: Include advertised listener for the Kafka Socket Server Settings (Greece)
268+
lineinfile:
269+
path: /opt/kafka/config/server.properties
270+
regexp: '#advertised.listeners=PLAINTEXT://your.host.name:9092'
271+
line: "advertised.listeners=PLAINTEXT://kafka.greece.iwl:9092"
272+
when: not update_module and site == "greece"
245273

246274
#- name: Remove Kafka logs
247275
# file:
@@ -277,6 +305,62 @@
277305
insertafter: EOF
278306
when: not update_module
279307

308+
- name: Change /etc/hosts in IWL (Spain)
309+
lineinfile:
310+
path: /etc/hosts
311+
line: "{{spanish_vpn_ip}} kafka.spain.iwl"
312+
insertafter: EOF
313+
when: not update_module and site == "iwl"
314+
315+
- name: Change /etc/hosts in IWL (Italy)
316+
lineinfile:
317+
path: /etc/hosts
318+
line: "{{italian_vpn_ip}} kafka-polito"
319+
insertafter: EOF
320+
when: not update_module and site == "iwl"
321+
322+
- name: Change /etc/hosts in IWL (France)
323+
lineinfile:
324+
path: /etc/hosts
325+
line: "{{french_vpn_ip}} kafka.france.iwl"
326+
insertafter: EOF
327+
when: not update_module and site == "iwl"
328+
329+
- name: Change /etc/hosts in IWL (Greece)
330+
lineinfile:
331+
path: /etc/hosts
332+
line: "{{greek_vpn_ip}} kafka.greece.iwl"
333+
insertafter: EOF
334+
when: not update_module and site == "iwl"
335+
336+
- name: Change /etc/hosts in site broker (Spain)
337+
lineinfile:
338+
path: /etc/hosts
339+
line: "{{ansible_host}} kafka.spain.iwl"
340+
insertafter: EOF
341+
when: not update_module and site == "spain"
342+
343+
- name: Change /etc/hosts in site broker (Italy)
344+
lineinfile:
345+
path: /etc/hosts
346+
line: "{{ansible_host}} kafka-polito"
347+
insertafter: EOF
348+
when: not update_module and site == "italy"
349+
350+
- name: Change /etc/hosts in site broker (France)
351+
lineinfile:
352+
path: /etc/hosts
353+
line: "{{ansible_host}} kafka.france.iwl"
354+
insertafter: EOF
355+
when: not update_module and site == "france"
356+
357+
- name: Change /etc/hosts in site broker (Greece)
358+
lineinfile:
359+
path: /etc/hosts
360+
line: "{{ansible_host}} kafka.greece.iwl"
361+
insertafter: EOF
362+
when: not update_module and site == "greece"
363+
280364
- name: Check if /etc/sudoers file has been modified previously
281365
shell: cat /etc/sudoers | grep "{{ansible_user}}" | grep NOPASSWD | wc -w
282366
register: etc_sudoers_check

roles/site_plugin_service/tasks/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@
3131
when: site == "italy"
3232

3333
- name: Create start-up service for DCM Site Plugin REST Client
34-
script: create_site_plugin_service.sh {{ansible_user}} {{ansible_host}} {{french_plugin_ip_port}} {{kafka_topics_script_route}}
34+
script: create_site_plugin_service.sh {{ansible_user}} {{ansible_host}} {{french_plugin_port}} {{kafka_topics_script_route}}
3535
when: site == "france"
3636

3737
- name: Create start-up service for DCM Site Plugin REST Client
38-
script: create_site_plugin_service.sh {{ansible_user}} {{ansible_host}} {{greek_plugin_ip_port}} {{kafka_topics_script_route}}
38+
script: create_site_plugin_service.sh {{ansible_user}} {{ansible_host}} {{greek_plugin_port}} {{kafka_topics_script_route}}
3939
when: site == "greece"
4040

4141
- name: Start DCM Site Plugin REST Client service

0 commit comments

Comments
 (0)