1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

toggle preserve_hostname for ubuntu18 server

This commit is contained in:
Jerry Vonau 2018-05-17 14:28:42 -05:00
parent c2118d1ec6
commit 44dc3563da

View file

@ -1,3 +1,16 @@
- name: Is ubuntu-18 server
stat:
path: /etc/cloud/cloud.cfg
register: U18_server
- name: edit cloud.cfg yaml
lineinfile:
dest: /etc/cloud/cloud.cfg
regexp: '^preserve_hostname*'
line: 'preserve_hostname: true'
state: present
when: U18_server is defined and U18_server.stat.exists
- name: Turn the crank for systemd (debuntu)
shell: hostnamectl set-hostname "{{ iiab_hostname }}.{{ iiab_domain }}"
when: is_debuntu