*Hi!* *I want to make the variable qos_policy set on conditional basis:* *If bandwidth_mb == '50'* * then qos_policy == 'qos-nested-'*
*else* * qos_policy == 'qos-nested-new-'* *My code is this (not working):* qos_policy: "{{ 'qos-nested-new-' + bandwidth_mb }}" qos_policy: "{{ 'qos-nested-' + bandwidth_mb }}" when: - bandwidth_mb == "50" bandwidth_mb: "some number" *Error:* [ansible@Netauto-Dev new_branch]$ ansible-playbook test_new_branch_playbook.yml PLAY [TEST5_TLV5] ************************************************************************************************************************* TASK [include_vars] *********************************************************************************************************************** ok: [R-TEST5-TLV5] TASK [include_role : new_branch] ********************************************************************************************************** ERROR! Syntax Error while loading YAML. did not find expected key The error appears to be in '/etc/ansible/roles/new_branch/tasks/configure_som_tlv5.yml': line 8, column 7, but may be elsewhere in the file depending on the exact syntax problem. The offending line appears to be: - qos_policy: "{{ 'qos-nested-' + bandwidth_mb }}" when: ^ here PLAY RECAP ******************************************************************************************************************************** R-TEST5-TLV5 : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 *What is the problem?* -- 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 ansible-project+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/8a211591-b2a7-4ebd-87ff-1060b80b9f02%40googlegroups.com.