mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Merge pull request #800 from jvonau/hostname
really call hostname.yml (U18 hostname was "ubuntu18base" even after reboot)
This commit is contained in:
commit
5a8ae0d2ae
2 changed files with 17 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)
|
||||
shell: hostnamectl set-hostname "{{ iiab_hostname }}.{{ iiab_domain }}"
|
||||
when: is_debuntu
|
||||
|
|
|
@ -161,6 +161,10 @@
|
|||
FQDN_changed: True
|
||||
when: iiab_fqdn != ansible_fqdn
|
||||
|
||||
- name: Setting hostname
|
||||
include_tasks: hostname.yml
|
||||
when: FQDN_changed
|
||||
|
||||
- name: Add version section
|
||||
ini_file:
|
||||
dest: "{{ iiab_config_file }}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue