https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters.html#making-variables-optional


On Wed, 9 Mar 2022 at 21:20, Nitrous <[email protected]> wrote:

> How would you make this work, only if ASG is provided:
>
> ip_configurations:
>       - name:xxxx
>         primary: True
>         private_ip_allocation_method: Static
>         private_ip_address: '{{ server.az_vm_ipaddress }}'
>         #application_security_groups: '{{ server.az_vm_asg }}'
>
> If in my az_vm_asg is not defined as a variable in my yaml file for the
> build, it errors out, saying:
>
> "The error was: 'dict object' has no attribute 'az_vm_asg'"
>
> So I have to comment out the asg section in the module for
> azure_rm_networkinterface, for the build to run. Is it possible to not have
> that commented out and still have a null variable accepted for az_vm_asg,
> in my yaml build file? Thanks
>
> --
> 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/674b3964-b6eb-4ce1-b955-b3cc8c57165dn%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/674b3964-b6eb-4ce1-b955-b3cc8c57165dn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
-- 
Sent from a mobile device - please excuse the brevity, spelling and
punctuation.

-- 
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/CAL8fbwPK3dKMy0PBFJ26zvyJSoTqeFd%3DZDrSs42zV21FDEYj7w%40mail.gmail.com.

Reply via email to