Skip to content

Instantly share code, notes, and snippets.

@rafaeltuelho
Last active June 22, 2023 15:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafaeltuelho/f908abd9ba0ad51c8f185c14c8b9dd46 to your computer and use it in GitHub Desktop.
Save rafaeltuelho/f908abd9ba0ad51c8f185c14c8b9dd46 to your computer and use it in GitHub Desktop.
- name: Tests playbook
hosts: localhost
gather_facts: no
vars:
num_users: 10
infra_template_object:
- name: infra
autoscale: false
total_replicas: 3
total_replicas_min: 3
total_replicas_max: 3
role: infra
taints:
- key: infra
value: reserved
effect: NoSchedule
- key: infra
value: reserved
effect: NoExecute
instance_type: "m5.4xlarge"
conditional_complex_var: |-
{{
infra_template_object if num_users >= 10 else {}
}}
tasks:
- name: infra-nodes
ansible.builtin.debug:
var: conditional_complex_var
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment