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
> 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