All checks were successful
continuous-integration/drone/push Build is passing
17 lines
509 B
YAML
17 lines
509 B
YAML
---
|
|
|
|
- name: Use hostname module to set hostname, or failback to command module
|
|
block:
|
|
- name: Set hostname for host using hostname module
|
|
ansible.builtin.hostname:
|
|
name: "{{ inventory_hostname }}"
|
|
notify:
|
|
- "Restart_syslog_{{ ansible_distribution | lower }}_{{ ansible_distribution_major_version }}"
|
|
|
|
rescue:
|
|
- name: Unable to set hostname
|
|
ansible.builtin.debug:
|
|
msg: "Unable to set hostname for {{ ansible_hostname }} to {{ inventory_hostname }}."
|
|
|
|
...
|