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

ansible_fqdn problematic for getting hostname #105

Closed
andor-pierdelacabeza opened this issue Jul 20, 2019 · 1 comment
Closed

ansible_fqdn problematic for getting hostname #105

andor-pierdelacabeza opened this issue Jul 20, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@andor-pierdelacabeza
Copy link

andor-pierdelacabeza commented Jul 20, 2019

This is half bug report, half feature request:

Describe the bug

In some nodes I'm getting weird hostnames, mostly localhost.localdomain. Those nodes show proper configuration in hostnamectl. I've seen you're using 'ansible_fqdn' as default.

Seems like ansible_fqdn and ansible_hostname can give different results, and sometimes even very weird results, as it sometimes makes DNS calls (which is not under my control in that cases) to infer that names.

Fix proposal

In my playbook I've added this parameter:

 telegraf_agent_hostname: "{{ ansible_nodename }}"

If you don't want to change the default on this role, for fear of breaking things, maybe it should be noted on the README that users might need or want to change it on their playbooks.

Installation method/version

  • Ansible Galaxy / 1.1.0

Ansible Version

ansible 2.8.2
  config file = /home/agonzalez/Documents/repos/monitoringdeployment/ansible.cfg
  configured module search path = ['/home/agonzalez/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/agonzalez/Documents/repos/monitoringdeployment/venv/lib/python3.7/site-packages/ansible
  executable location = /home/agonzalez/Documents/repos/monitoringdeployment/venv/bin/ansible
  python version = 3.7.3 (default, Apr  3 2019, 05:39:12) [GCC 8.3.0]

Targetted hosts
Concerns the following OS(es):

  • Ubuntu
  • Debian
@dj-wasabi dj-wasabi added enhancement New feature or request help wanted labels Oct 24, 2019
@dj-wasabi
Copy link
Owner

Hi @andor-pierdelacabeza

I updated the README.md : https://github.com/dj-wasabi/ansible-telegraf#ansible-fqdn-problematic-for-getting-hostname

Thanks! 👍

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

No branches or pull requests

2 participants