use hostanem module instead of template
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Robert Kaussow 2020-11-23 21:42:14 +01:00
parent 1b17be5802
commit 5189b87321
Signed by: xoxys
GPG Key ID: 65362AE74AF98B61
2 changed files with 3 additions and 11 deletions

View File

@ -1,13 +1,9 @@
--- ---
- block: - block:
- name: Set hostname - name: Set hostname
template: hostname:
src: etc/hostname.j2 name: "{{ network_hostname }}"
dest: /etc/hostname when: network_hostname
owner: root
group: root
mode: 0644
register: hostname_result
notify: __host_reboot notify: __host_reboot
- name: Set hosts file - name: Set hosts file
@ -17,7 +13,6 @@
owner: root owner: root
group: root group: root
mode: 0644 mode: 0644
register: hosts_result
notify: __host_reboot notify: __host_reboot
- name: Add network interface configuration - name: Add network interface configuration

View File

@ -1,3 +0,0 @@
{% if network_hostname is defined %}
{{ network_hostname }}
{% endif %}