Skip to content
This repository was archived by the owner on Feb 13, 2023. It is now read-only.

Commit 1fc8ca7

Browse files
committed
Issue #1760: Now fix the hostname stuff.
1 parent e6aba11 commit 1fc8ca7

File tree

1 file changed

+4
-4
lines changed
  • provisioning/roles/drupalvm.hostname/tasks

1 file changed

+4
-4
lines changed

provisioning/roles/drupalvm.hostname/tasks/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
dest: /etc/mailname
66
when:
77
- ansible_os_family == 'Debian'
8-
- hostname_fqdn
8+
- hostname_fqdn != ''
99

1010
- name: Add hostname to /etc/hosts.
1111
lineinfile:
@@ -14,19 +14,19 @@
1414
line: "127.0.0.1\t{{ hostname_fqdn }}\t{{ hostname_short }}"
1515
state: present
1616
unsafe_writes: "{{ hostname_unsafe_writes }}"
17-
when: hostname_fqdn
17+
when: hostname_fqdn != ''
1818

1919
- name: Configure hostname.
2020
copy:
2121
content: "{{ (ansible_os_family == 'Debian') | ternary(hostname_short, hostname_fqdn) }}\n"
2222
dest: /etc/hostname
2323
unsafe_writes: "{{ hostname_unsafe_writes }}"
2424
register: set_hostname
25-
when: hostname_fqdn
25+
when: hostname_fqdn != ''
2626

2727
- name: Set the hostname for current session.
2828
command: hostname --file /etc/hostname
2929
when:
3030
- set_hostname is changed
31-
- hostname_fqdn
31+
- hostname_fqdn != ''
3232
tags: ['skip_ansible_lint']

0 commit comments

Comments
 (0)