Hi
I’m using lineinfile to include new value inside a file
Original line
Kafka-list= kafka1:9092;kafka2:9092;kafka3:9092
I need to replace the value with parameters that are managed inside a configuration – I need to include all server hostname that are under kafka_server_details section
The line format should be <kafka-server-hostname>:<kafka-port>;<kafka-server-hostname>:<kafka-port>; ……
The list can include 1 or more servers
Configuration File :
kafka_server_details:
- {ip: 1.1.1.1 , hostname: kafka1.cluster1.com
}
- {ip: 1.1.1.2 , hostname: kafka2.cluster1.com }
- {ip: 1.1.1.3 , hostname: kafka3.cluster1.com }
kafka_port: 9092
Playbook
- name: Update flow.properties file