hostname: Reformatted to newer syntax allowing multiple handlers in notify

dehydrated
Felix Stupp 4 years ago
parent 72f3e603d8
commit a707a61906
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -4,20 +4,23 @@
copy: copy:
content: "{{ hostname }}\n" content: "{{ hostname }}\n"
dest: /etc/hostname dest: /etc/hostname
notify: restart systemd-hostnamed notify:
- restart systemd-hostnamed
- name: Set hostname and fqdn as alias for ipv4 - name: Set hostname and fqdn as alias for ipv4
lineinfile: lineinfile:
path: /etc/hosts path: /etc/hosts
regexp: '^127\.0\.0\.1\s' regexp: '^127\.0\.0\.1\s'
line: "127.0.0.1 {{ fqdn }} {{ hostname }} localhost *.localhost" line: "127.0.0.1 {{ fqdn }} {{ hostname }} localhost *.localhost"
notify: restart systemd-hostnamed notify:
- restart systemd-hostnamed
- name: Set hostname and fqdn as alias for ipv6 - name: Set hostname and fqdn as alias for ipv6
lineinfile: lineinfile:
path: /etc/hosts path: /etc/hosts
regexp: '^::1\s' regexp: '^::1\s'
line: "::1 {{ fqdn }} {{ hostname }} localhost *.localhost ip6-localhost ip6-loopback" line: "::1 {{ fqdn }} {{ hostname }} localhost *.localhost ip6-localhost ip6-loopback"
notify: restart systemd-hostnamed notify:
- restart systemd-hostnamed
- meta: flush_handlers - meta: flush_handlers

Loading…
Cancel
Save