--- - name: "[OpenRC] Restart service: influxdb (to deploy config changes)" service: name: influxdb state: restarted when: - ansible_service_mgr == "openrc" listen: "Restart influxdb" - name: "[systemd] Restart service: influxdb (to deploy config changes)" systemd: name: influxdb state: restarted when: - ansible_service_mgr == "systemd" listen: "Restart influxdb"