---

service_state_commands:
  - key: up
    command: "docker-compose up -d"
  - key: down
    command: "docker-compose down"
  - key: upgrade
    command: "docker-compose pull && docker-compose down && docker-compose up -d"

service_state_command: "{{ service_state_commands
  | selectattr('key', 'match', service_state )
  | map(attribute='command')
  | list
  | first }}"