In my playbook, I have this:
#More things - include: deploy_new.yml vars: service_type: "{{ expose_service == 'true' | ternary('NodePort', 'ClusterIP') }}" when: service_up|failed
When expose_service
is true, I want service_type
to be set to NodePort, and ClusterIP otherwise.
However, service_type
is set to False
in all cases.
What am I doing wrong?
Solved!
service_type: "{{ 'NodePort' if expose_service == 'true' else 'ClusterIP' }}"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With