1609
This commit is contained in:
@@ -429,7 +429,6 @@
|
|||||||
payload_encoding: "string"
|
payload_encoding: "string"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
# ----------------------- Dev1 SSID count (strict then fallback) -----------------------
|
|
||||||
# ----------------------- Dev1 SSID count (strict then fallback) -----------------------
|
# ----------------------- Dev1 SSID count (strict then fallback) -----------------------
|
||||||
- name: Dev1 | Count SSID lines (strict 'ssid' + 'ikeja')
|
- name: Dev1 | Count SSID lines (strict 'ssid' + 'ikeja')
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
@@ -445,12 +444,17 @@
|
|||||||
- name: Dev1 | Normalize strict SSID count
|
- name: Dev1 | Normalize strict SSID count
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
set_fact:
|
set_fact:
|
||||||
ssid_strict_count: "{{ (ssid_strict_count_raw.stdout | default('0')) | trim | int }}"
|
# Keep as text; we’ll cast with | int when using it
|
||||||
|
ssid_strict_count: "{{ (ssid_strict_count_raw.stdout | default('0')) | trim }}"
|
||||||
|
|
||||||
- name: Dev1 | Decide if strict count usable
|
- name: Dev1 | Decide if strict count usable
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
set_fact:
|
set_fact:
|
||||||
ssid_strict_ok: "{{ ssid_strict_count > 0 and (ssid_strict_count % 2 == 0) }}"
|
ssid_strict_ok: >-
|
||||||
|
{{
|
||||||
|
(ssid_strict_count | int) > 0
|
||||||
|
and ((ssid_strict_count | int) % 2 == 0)
|
||||||
|
}}
|
||||||
|
|
||||||
- name: Dev1 | Count SSID lines (fallback exclude bssid/auto_ssid/SC/backhaul)
|
- name: Dev1 | Count SSID lines (fallback exclude bssid/auto_ssid/SC/backhaul)
|
||||||
when: not ssid_strict_ok | default(false)
|
when: not ssid_strict_ok | default(false)
|
||||||
@@ -468,7 +472,8 @@
|
|||||||
when: not ssid_strict_ok | default(false)
|
when: not ssid_strict_ok | default(false)
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
set_fact:
|
set_fact:
|
||||||
ssid_fallback_count: "{{ (ssid_fallback_count_raw.stdout | default('0')) | trim | int }}"
|
# Also keep as text
|
||||||
|
ssid_fallback_count: "{{ (ssid_fallback_count_raw.stdout | default('0')) | trim }}"
|
||||||
|
|
||||||
- name: Dev1 | Compute final SSID count
|
- name: Dev1 | Compute final SSID count
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
@@ -477,8 +482,8 @@
|
|||||||
{{
|
{{
|
||||||
(ssid_strict_ok | default(false))
|
(ssid_strict_ok | default(false))
|
||||||
| ternary(
|
| ternary(
|
||||||
(ssid_strict_count | default(0)) // 2,
|
(ssid_strict_count | default('0') | int) // 2,
|
||||||
(ssid_fallback_count | default(0)) // 2
|
(ssid_fallback_count | default('0') | int) // 2
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user