Use hostname module to set hostname, and do it for all Os not only CoreOS

This commit is contained in:
Paweł Skrzyński
2017-03-27 12:27:15 +02:00
parent c2c334d22f
commit 61b2d7548a
2 changed files with 12 additions and 9 deletions

View File

@@ -16,4 +16,15 @@
register: ostree
- set_fact:
is_atomic: "{{ ostree.stat.exists }}"
is_atomic: "{{ ostree.stat.exists }}"
- name: Gather nodes hostnames
setup:
gather_subset: '!all'
filter: ansible_hostname
- name: Assign inventory name to unconfigured hostnames
hostname:
name: "{{inventory_hostname}}"
when: ansible_hostname == 'localhost'