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:
parent
c2118d1ec6
commit
44dc3563da
1 changed files with 13 additions and 0 deletions
|
@ -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)
|
- name: Turn the crank for systemd (debuntu)
|
||||||
shell: hostnamectl set-hostname "{{ iiab_hostname }}.{{ iiab_domain }}"
|
shell: hostnamectl set-hostname "{{ iiab_hostname }}.{{ iiab_domain }}"
|
||||||
when: is_debuntu
|
when: is_debuntu
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue