Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom location for zoo.cfg.j2 template or change ansible_nodename #34

Closed
eRadical opened this issue Apr 20, 2022 · 1 comment
Closed

Comments

@eRadical
Copy link

Hello Simon,

I'm trying not to change the downloaded role as this might make it harder to keep it in sync w/ the future versions.

We have an inventory like:

---
zk_cluster_devel:
  hosts:
    "zk-cluster-[01:03].example.com":
      provider: aws
      ......................

As seen above the machine is in AWS and the default hostname is generated in the form ip-internal-ip which is not valid as it does not resolve to anything.
I tried inventory_hostname but it added zk-cluster-01.example.com and then ZK complained w/ "Have smaller server identifier, so dropping the connection".

The only viable solution was hostvars[host].ansible_all_ipv4_addresses[0].
(I would have tried ansible_default_ipv4 but the article https://medium.com/opsops/ansible-default-ipv4-is-not-what-you-think-edb8ab154b10 discouraged me.)

I'll make the PR, but I would like to know what path would you like me to take:

Thanx!

@eRadical
Copy link
Author

Satisfied by #38.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant