Templating help please (If true then run script)

I am trying to reduce the number of automations I have and also learn how to use templates. My question is, how do I do this:

{% if is_state("weather.my_ecobee", "cloudy") -%}
trigger.script.cloudy <==I know this isn't correct, I just don't know how to format it
{% elif is_state("weather.my_ecobee", "snowy") -%}
trigger.script.snowy
{% elif is_state("weather.my_ecobee", "rainy") -%}
trigger.script.rainy
 {%- endif %}
automation:
  trigger:
    YOUR TRIGGER
  action:
    service: >
      {% if is_state("weather.my_ecobee", "cloudy") %} script.cloudy
      {% elif is_state("weather.my_ecobee", "snowy") %} script.snowy
      {% elif is_state("weather.my_ecobee", "rainy") %} script.rainy
      {% else %} YOUR_ALTERNATIVE_FOR_IF_WEATHER_IS_NOT CLOUDY, SNOWY OR RAINY
      {% endif %}