# platform = multi_platform_all
# reboot = false
# strategy = disable
# complexity = low
# disruption = low
- name: Disable service {{{ SERVICENAME }}}
  service:
    name: "{{item}}"
    enabled: "no"
    state: "stopped"
  register: service_result
  failed_when: "service_result is failed and ('Could not find the requested service' not in service_result.msg)"
  with_items:
    - {{{ DAEMONNAME }}}
  tags:
    @ANSIBLE_TAGS@

{{% if init_system == "systemd" %}}
- name: Disable socket of service {{{ SERVICENAME }}} if applicable
  service:
    name: "{{item}}"
    enabled: "no"
    state: "stopped"
  register: socket_result
  failed_when: "socket_result is failed and ('Could not find the requested service' not in socket_result.msg)"
  with_items:
    - {{{ DAEMONNAME }}}.socket
  tags:
    @ANSIBLE_TAGS@
{{% endif %}}
