--- # This is necessary to flush the handlers before the when is set, because otherwise the when will be attached to the handlers - meta: flush_handlers - name: Set “run-once” fact for role {{ role_name }} set_fact: "{{ 'run_once_' + (role_name | lower | replace('-', '_')) }}": true