tasks:
- fail: msg="Please pass kfkaCnt variable from command line"
when: kfkaCnt is not defined
- fail: msg="Please pass zkLoc variable to specify local or remote zookeeper"
when: zkLoc is not defined
- set_fact:
zLoc: "none"
- set_fact:
zLoc: "localZookService"
when: zkLoc == "local"
- set_fact:
zLoc: "remoteZookService"
when: zkLoc == "remote"
- set_fact:
nodeCnt: "none"
- set_fact:
nodeCnt: "3node"
when: kfkaCnt == "3"
- set_fact:
nodeCnt: "5node"
when: kfkaCnt == "5"
- fail: msg="Please pass valid kfkaCnt variable from command line"
when: kfkaCnt == "none"
- fail: msg="Please pass valid zkLoc variable local or remot"
when: zLoc == "none"
- include_vars:
dir: './group_vars'
depth: 1
- template:
src: ./files/{{ nodeCnt }}/kfhost{{ play_hosts.index(inventory_hostname) }}.j2
dest: /app/bin/kafka/config/server.properties
- copy:
src: ./files/common/{{ zLoc }}
dest: /usr/lib/systemd/system/kafka.service
- command: systemctl daemon-reload
as you can see i have a template, copy and command module among others. How is this working?