updated vhost_alias logic
diff --git a/tasks/main.yml b/tasks/main.yml
index 8d78684..33b2a35 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -35,28 +35,28 @@
   - name: Set vhost_alias to load_balancer
     cache:
       key: "vhost_alias"
-      value: "{{ load_balancer }}"
+      value: "{{ load_balancer | trim }}"
   when: load_balancer is defined and load_balancer | trim | length > 0
 
 - block:
   - name: Collect DC 1 RMP addresses
     cache:
       key: "vhost_alias"
-      value: "{{ vhost_alias }} {{ hostvars[item].public_address }}"
+      value: "{{ vhost_alias | trim }} {{ hostvars[item].public_address | trim }}"
     with_items: "{{ groups['dc-1-rmp'] }}"
     when: groups['dc-1'] is defined and inventory_hostname in groups['dc-1']
 
   - name: Collect DC 2 RMP addresses
     cache:
       key: "vhost_alias"
-      value: "{{ vhost_alias }} {{ hostvars[item].public_address }}"
+      value: "{{ vhost_alias | trim }} {{ hostvars[item].public_address | trim }}"
     with_items: "{{ groups['dc-2-rmp'] }}"
     when: groups['dc-2'] is defined and inventory_hostname in groups['dc-2']
 
   - name: Collect DC 3 RMP addresses
     cache:
       key: "vhost_alias"
-      value: "{{ vhost_alias }} {{ hostvars[item].public_address }}"
+      value: "{{ vhost_alias | trim }} {{ hostvars[item].public_address | trim }}"
     with_items: "{{ groups['dc-3-rmp'] }}"
     when: groups['dc-3'] is defined and inventory_hostname in groups['dc-3']
   when: load_balancer is not defined or load_balancer | trim | length == 0