Rocket.Chat.Ansible icon indicating copy to clipboard operation
Rocket.Chat.Ansible copied to clipboard

hosts file management

Open hatifnatt opened this issue 7 years ago • 0 comments

Currently playbook will update hosts with line

127.0.1.1    {{ ansible_nodename }} {{ ansible_hostname }}

I assume it's expected that it will be expanded as

127.0.1.1   host.fqdn hostname

but ansible_nodename on Debian based OS will expand into hostname only not into fqdn, as result line in hosts will be like

127.0.1.1   hostname hostname

That is not expected behavior.

Also it's will be great to allow user completely skip hosts file management, it's not good pattern to manage config files with search and replace. I.e. variable can be added like rocket_chat_manage_hosts: true and in task check this var

- name: "Configure /etc/hosts"
  ...
  when:
    - ansible_virtualization_type != "docker"
    - rocket_chat_manage_hosts

I implemented these changes in my fork if they looks fine I will create PR.

hatifnatt avatar Feb 25 '19 12:02 hatifnatt