Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions roles/sap_maintain_etc_hosts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ Example playbook will update `/etc/hosts`:
hosts: all
become: true
tasks:
- name: Execute Ansible Role sap_sap_maintain_etc_hosts
- name: Execute Ansible Role sap_maintain_etc_hosts
ansible.builtin.include_role:
name: community.sap_install.sap_sap_maintain_etc_hosts
name: community.sap_install.sap_maintain_etc_hosts
vars:
sap_maintain_etc_hosts_list:
- node_ip: 10.10.10.10
Expand All @@ -62,9 +62,9 @@ Example playbook when executed together with [sap_ha_pacemaker_cluster](https://
hosts: all
become: true
tasks:
- name: Execute Ansible Role sap_sap_maintain_etc_hosts
- name: Execute Ansible Role sap_maintain_etc_hosts
ansible.builtin.include_role:
name: community.sap_install.sap_sap_maintain_etc_hosts
name: community.sap_install.sap_maintain_etc_hosts
vars:
sap_maintain_etc_hosts_list: "{{ sap_ha_pacemaker_cluster_cluster_nodes }}"
```
Expand Down
2 changes: 1 addition & 1 deletion roles/sap_maintain_etc_hosts/tasks/update_host_present.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
ansible.builtin.lineinfile:
path: "{{ __sap_maintain_etc_hosts_file }}"
regexp: '^{{ thishost.node_ip }}\s'
line: "{{ thishost.node_ip }} {{ thishost.node_name }}.{{ __sap_maintain_etc_hosts_domain }} {{ thishost.node_name }} {{ __sap_maintain_etc_hosts_aliases }} {{ __sap_maintain_etc_hosts_comment }}"
line: "{{ thishost.node_ip }}\t{{ thishost.node_name }}.{{ __sap_maintain_etc_hosts_domain }} {{ thishost.node_name }} {{ __sap_maintain_etc_hosts_aliases }} {{ __sap_maintain_etc_hosts_comment }}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found no indications for a preferred separator character for /etc/hosts. Some customers might prefer tabs, others might prefer spaces. Especially if hostnames have a length close to a multiple of 8 characters, /etc/hosts lines might be more difficult to read. So maybe it is now the time to introduce a new role variable for setting the separator character to either space or tab, with space as the default (e.g. for backward compatibility).

backup: true
when:
- not ansible_check_mode
Expand Down