--- - name: Hourly Restarts (ALL NODES) hosts: privfrontends vars: services: - invidious-invidious-1 - breezewiki - anonymousoverflow-anonymousoverflow-1 - simplytranslate-simplytranslate-1 - scribe - libreddit-libreddit-1 - teddit tasks: - name: Do thing ansible.builtin.command: docker restart {{ item }} register: out changed_when: out.rc != 0 with_items: "{{ services }}"