Reputation: 1850
I'm using the latest Altoros/Ansible-Fabric-Starter and when I'm running ansible-playbook install-python.yml -i hosts_kafka.yml, it throws an error in the terminal saying : ERROR! ERROR! hosts_kafka.yml:5: Expected key=value host variable assignment, got: local I'm running it on my local system. Here is my kafka. yml
all:
hosts:
localhost: # localhost connection parameters, used for storing configuration while transferring it between nodes
ansible_connection: local
vars:
domain: example.com
additional_channels: # optional, common channels are created by default. Just comment it out, if you don't need additional channels.
- name: a-b # channel name
particapants: # Organizations, should be included in channel
- a
- b
- name: a-c
particapants:
- a
- c
- name: b-c
particapants:
- b
- c
orderer_type: kafka # Enable kafka orderer, we'll have 4 brokers and 3 zookeepers.
orderer_count: 3 # Amount of orderers in network, assumed that it equals to amount of organization, so each org will have an own orderer copy
kafka_replicas: 2 # Set kafka_replicas parameter
kafka_replication_factor: 3 # Set kafka_replication_factor parameter (https://hyperledger-fabric.readthedocs.io/en/release-1.2/kafka.html)
children:
nodes:
hosts:
kafka.example.com: # Describes which containers will run on this node
node_roles:
- zookeeper # Apache zookeeper instance
- kafka_broker # Apache kafka instance
org: kafka # Organization name
zookeeper_id: 0 # ID for zookeeper
kafka_broker_id: 0 # ID for kafka-broker
ansible_host: 172.16.16.1 # Real ip address or domain name of the machine
ansible_user: username # User with sudo access
ansible_private_key_file: ~/path-to-private-key # Private key to identify ourselves
ansible_ssh_port: 22 # Specify ssh-port here, if case of it's not defaulted.
# Same structure for any other nodes
a.example.com:
node_roles:
- root_orderer # This node will be used to generate crypto-config for other orderers
- orderer # This node will host an orderer-service
- peer # This node will host peers and api containers for organization
- root_peer # This node will be used to create channels and instantiate chaincode
- zookeeper # Hosts zookeeper container for kafka-cluster
- kafka_broker # Hosts broker container for kafka-cluster
- explorer
org: a
orderer_id: 0 # ID of orderer-service which is running on this host
zookeeper_id: 1
kafka_broker_id: 1
ansible_host: 172.16.16.2
ansible_user: username
ansible_private_key_file: ~/path-to-private-key
ansible_ssh_port: 22
b.example.com:
node_roles:
- orderer
- peer
- zookeeper
- kafka_broker
org: b
orderer_id: 1
zookeeper_id: 2
kafka_broker_id: 2
ansible_host: 172.16.16.3
ansible_user: username
ansible_private_key_file: ~/path-to-private-key
ansible_ssh_port: 22
c.example.com: # This node will host only kafka-broker and peer.
node_roles:
- peer
- orderer
- kafka_broker
org: c
orderer_id: 2
kafka_broker_id: 3
ansible_host: 172.16.16.4
ansible_user: username
ansible_private_key_file: ~/path-to-private-key
ansible_ssh_port: 22
Upvotes: 2
Views: 1241
Reputation: 1850
Hi i found the answer myself here after researching and what i found was that it can be fixed by reinstalling ansible 2.5.0+ and you're done.
Upvotes: 1