use common framework for management infrastructure
[awsible] / roles / launchconfig / tasks / main.yml
index 59768fdf2b87257ecdbe3aa48764620dd2f1de41..ced0bcd16dc8f2ae742429f6fc149fc85bde69af 100644 (file)
 - set_fact:
     ud_cluster:
     - "{{ module }}"
-    - "{{ country|ternary('c0', '') }}{{ country|default('') }}"
-    - "{{ phase|ternary('d0', '') }}{{ phase|default('') }}"
+    - "{{ (country|default() != '')|ternary('c0', '') }}{{ country|default('') }}"
+    - "{{ (phase|default() != '')|ternary('d0', '') }}{{ phase|default('') }}"
 
 - set_fact:
     ud_asgn:
     - "{{ module }}"
     - "{{ stack|default('') }}"
-    - "{{ country|ternary('c0', '') }}{{ country|default('') }}"
-    - "{{ phase|ternary('d0', '') }}{{ phase|default('') }}"
+    - "{{ (country|default() != '')|ternary('c0', '') }}{{ country|default('') }}"
+    - "{{ (phase|default() != '')|ternary('d0', '') }}{{ phase|default('') }}"
 
 - set_fact:
     lc_n:
     - "{{ module }}"
     - "{{ stack|default('') }}"
-    - "{{ country|ternary('c0', '') }}{{ country|default('') }}"
-    - "{{ phase|ternary('d0', '') }}{{ phase|default('') }}"
+    - "{{ (country|default() != '')|ternary('c0', '') }}{{ country|default('') }}"
+    - "{{ (phase|default() != '')|ternary('d0', '') }}{{ phase|default('') }}"
     - "{{ version }}"
 
 - name: assemble user data