Hi guys!
This is my code:
---
qos_policy: qos-nested-new-10m
when: "{{ bandwidth_mb }} == '10'"
qos_policy: qos-nested-new-20m
when: "{{ bandwidth_mb }} == '20'"
#### Modify: ####
bandwidth_mb: 10
*I'm trying to create a condition for the qos_policy variable:*
if bandwidth_mb = 10 then qos_policy = qos-nested-new-10m
if bandwidth_mb = 20 then qos_policy = qos-nested-new-20m
*Just for clarification:*
• bandwidth_mb & qos_policy are variables
• qos-nested-new-10m & qos-nested-new-20m are strings
*The errors im receiving on all my previous attempts to do this code are:*
1. invalid syntax
2. duplicate value for qos_policy applying only the last value (always
qos-nested-new-20m)
I receive these errors seperatly, depending on how I change the code but
its still not working like it should.
What am I doing wrong here?
Thanks in advance,
YP
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/0d21767a-703e-4b9f-810c-dfb5aed5bf0a%40googlegroups.com.