Hi guys!
Solved.
Solution:
qos_policy: "{{ 'qos-nested-50m' if bandwidth_mb == 50 else
'qos-nested-new-' ~ bandwidth_mb ~ 'm' }}"
Thanks for all replys.
Peace out.
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this
Hi!
Both solutions given are not working for some reason..
Any other suggestions?
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
> > There are two options for that string:
> > 1. qos-nested-50 will be set when bandwidth_mb is 50.
> > 2. qos-nested-new-20. 20 for example will set the string to qos-nested-new-
> > when bandwidth_mb is not 50.
It's possible to use the 'ternary' filter. For example
- set_fact:
On Thu, 23 Jan 2020 06:22:37 -0800 (PST)
Yehuda Pinhas wrote:
> qos_policy: "{{ 'qos-nested-' + bandwidth_mb }}"
> [...]
> **
>
> ERROR! Syntax Error while loading YAML. did not find
On 1/23/20 3:22 PM, Yehuda Pinhas wrote:
> *Hi!*
> *I want to make the variable qos_policy set on conditional basis:*
> *
> *
> *If bandwidth_mb == '50'*
> * then qos_policy == 'qos-nested-50'*
> *
> *
> *else*
> * qos_policy == 'qos-nested-new-50'*
> *
> *
> *
> *
> *My code is this (not
*Hi!*
*I want to make the variable qos_policy set on conditional basis:*
*If bandwidth_mb == '50'*
* then qos_policy == 'qos-nested-50'*
*else*
* qos_policy == 'qos-nested-new-50'*
*My code is this (not working):*
qos_policy: "{{ 'qos-nested-new-' + bandwidth_mb }}"
qos_policy: "{{