1
0
Fork 0
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:
A Holt 2018-05-17 16:54:16 -04:00 committed by GitHub
commit 5a8ae0d2ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

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

View file

@ -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 }}"