lab_domain is used to strip the domain from the nodes hostname, this
allows that task to be skipped if lab_domain isn't provided. I believe
we only do this because of some quirk in how cobbler images our rhel
nodes, we might not even need this functionality.
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
# mount options, which is useful for long lived bare metal machines,
# less useful for virtual machines that are re-imaged before each job
modify_fstab: true
+
+# used to remove lab_domain from the hostname on rhel nodes
+# FIXME: I believe this is only needed because of a quirk in how rhel
+# nodes are imaged in our labs. This might not be needed at all.
+lab_domain: ""
set_fact:
new_hostname: "{{ existing_hostname.stdout.split('.')[0] }}"
when: existing_hostname is defined and
- existing_hostname.stdout.find("{{ lab_domain | mandatory }}") != -1
+ existing_hostname.stdout.find("{{ lab_domain }}") != -1
- name: Set hostname.
hostname:
---
- name: Set the hostname
include: redhat/set_hostname.yml
+ when: lab_domain != ""
tags:
- hostname