]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
testnode: make lab_domain an optional var
authorAndrew Schoen <aschoen@redhat.com>
Thu, 9 Jul 2015 19:26:05 +0000 (14:26 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Thu, 9 Jul 2015 21:52:46 +0000 (16:52 -0500)
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>
roles/testnode/defaults/main.yml
roles/testnode/tasks/redhat/set_hostname.yml
roles/testnode/tasks/setup-redhat.yml

index b6218902ac1a85981f3b3fae6189b05951d0afc5..08b78c315a9df1b23471f74d39e18b9381a95d67 100644 (file)
@@ -27,3 +27,8 @@ start_rpcbind: true
 # 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: ""
index d49bbdaae36aee5da2926afd5dcbc8877269fc9f..3424f67c7025ca563cf80d82faf943e280bbd243 100644 (file)
@@ -14,7 +14,7 @@
   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:
index 2018a7c357a13a408a2a340c44726bd2b40dd244..073d8a1cb78c1f4daa3e51f83a39c125ba509447 100644 (file)
@@ -1,6 +1,7 @@
 ---
 - name: Set the hostname
   include: redhat/set_hostname.yml
+  when: lab_domain != ""
   tags:
     - hostname