Comments (3)
Hi @ken-tune .
Presumably based on your usage of kafka_tag
you're using AWS and dynamic inventory. What script/tooling are you using for this?
At first glance it looks like maybe you're defining this at the playbook level so it may not be evaluated per host, as opposed to using it in the host vars...? For example, if this evaluates to 1
initially and is then passed to the role as the default value then due to there not being an individual zookeeper_id
on each host then it will fall back on the default. See https://github.com/sleighzy/ansible-zookeeper/blob/master/templates/zoo.cfg.j2#L48
server.{{ hostvars[host].zookeeper_id | default(zookeeper_id) }}.............
Presumably the /var/lib/zookeeper/myid
file on all your nodes contain this same 1
value as well?
I don't know how you currently tag your EC2 instances but you could specify this value on a tag there, e.g. named zookeeper_id
, and then use that in the host vars although I don't know how much additional overhead this adds for you.
I'll need to set aside some time to test similar config to yours locally to see if I can replicate and provide something more helpful.
from ansible-zookeeper.
Hi @sleighzy
If it helps, what's seen on the other two hosts is
server.2=ip-10-0-0-65.ec2.internal:2888:3888
server.2=ip-10-0-1-234.ec2.internal:2888:3888
server.2=ip-10-0-2-207.ec2.internal:2888:3888
&
server.3=ip-10-0-0-65.ec2.internal:2888:3888
server.3=ip-10-0-1-234.ec2.internal:2888:3888
server.3=ip-10-0-2-207.ec2.internal:2888:3888
with the content of /var/lib/zookeeper/myid matching the X in server.X in each case. So zookeeper_id is being evaluated at the host level.
I can figure out a workaround ( run a subsequent process to correct) so maybe will just leave this with you and if I have some free cycles will figure out a patch if you don't beat me to it.
from ansible-zookeeper.
Related Issues (14)
- FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'zookeeper_id'"} HOT 4
- Error Task HOT 4
- sleighzy.zookeeper return AnsibleUndefinedVariable HOT 2
- inventory file HOT 2
- Support zookeeper > 3.4.14 HOT 4
- Custom location for `zoo.cfg.j2` template or change ansible_nodename HOT 1
- Add the ability to template any parameters into the zoo.cfg file
- Role installation failing on Ubuntu Ansible Controller v. 2.9.6 HOT 1
- Add a sample in readme to allow "zookeeper_servers" property from hosts list
- Change hardcoded ports in firewalld.yml file
- Add firewall rule for Debian using ufw
- Error: JAVA_HOME is not set and java could not be found in PATH. HOT 1
- 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'zookeeper_id'"} HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-zookeeper.