---
################################################################################
# OCtopous
################################################################################
- name: Restart OCtopus Email Sending Service
  ansible.builtin.systemd:
    name: ocemailsending
    state: restarted
  register: ocemailsending_restarted
  until: ocemailsending_restarted is succeeded
  retries: 3
  delay: 5

- name: Restart OCtopus Uploader Service
  ansible.builtin.systemd:
    name: ocuploader
    state: restarted
  register: ocuploader_restarted
  until: ocuploader_restarted is succeeded
  retries: 3
  delay: 5

################################################################################
# Nginx
################################################################################
- name: Reload Nginx
  ansible.builtin.systemd:
    name: nginx
    state: reloaded
  register: nginx_reloaded
  until: nginx_reloaded is succeeded
  retries: 3
  delay: 5

- name: Restart Nginx
  ansible.builtin.systemd:
    name: nginx
    state: restarted
  register: nginx_restarted
  until: nginx_restarted is succeeded
  retries: 3
  delay: 5

################################################################################
# Redis
################################################################################
- name: Restart redis server
  ansible.builtin.systemd:
    name: redis-server
    state: restarted
  register: redis_server_restarted
  until: redis_server_restarted is succeeded
  retries: 3
  delay: 5

- name: Restart redis server cache
  ansible.builtin.systemd:
    name: redis-server-cache
    state: restarted
  register: redis_server_cache_restarted
  until: redis_server_cache_restarted is succeeded
  retries: 3
  delay: 5

- name: Restart redis server sentinel
  ansible.builtin.systemd:
    name: redis-server-sentinel
    state: restarted
  register: redis_server_sentinel_restarted
  until: redis_server_sentinel_restarted is succeeded
  retries: 3
  delay: 5

################################################################################
# Elasticsearch
################################################################################
- name: Restart Elasticsearch
  ansible.builtin.systemd:
    name: elasticsearch
    state: restarted
  register: elasticsearch_restarted
  until: elasticsearch_restarted is succeeded
  retries: 3
  delay: 5

################################################################################
# Elasticsearch
################################################################################
- name: Restart elasticsearch
  ansible.builtin.systemd:
    name: elasticsearch
    state: restarted
  register: elasticsearch_restarted
  until: elasticsearch_restarted is succeeded
  retries: 3
  delay: 5

################################################################################
# Squirro
################################################################################
- name: Restart sqconfigurationd
  ansible.builtin.systemd:
    name: sqconfigurationd
    state: restarted
  register: sqconfigurationd_restarted
  until: sqconfigurationd_restarted is succeeded
  retries: 3
  delay: 5

- name: Restart sqcontentd
  ansible.builtin.systemd:
    name: sqcontentd
    state: restarted
  register: sqcontentd_restarted
  until: sqcontentd_restarted is succeeded
  retries: 3
  delay: 5

- name: Restart sqdatasourced
  ansible.builtin.systemd:
    name: sqdatasourced
    state: restarted
  register: sqdatasourced_restarted
  until: sqdatasourced_restarted is succeeded
  retries: 3
  delay: 5

- name: Restart sqdigestmailerd
  ansible.builtin.systemd:
    name: sqdigestmailerd
    state: restarted
  register: sqdigestmailerd_restarted
  until: sqdigestmailerd_restarted is succeeded
  retries: 3
  delay: 5

- name: Restart sqemailsenderd
  ansible.builtin.systemd:
    name: sqemailsenderd
    state: restarted
  register: sqemailsenderd_restarted
  until: sqemailsenderd_restarted is succeeded
  retries: 3
  delay: 5

- name: Restart sqfilteringd
  ansible.builtin.systemd:
    name: sqfilteringd
    state: restarted
  register: sqfilteringd_restarted
  until: sqfilteringd_restarted is succeeded
  retries: 3
  delay: 5

- name: Restart sqfingerprintd
  ansible.builtin.systemd:
    name: sqfingerprintd
    state: restarted
  register: sqfingerprintd_restarted
  until: sqfingerprintd_restarted is succeeded
  retries: 3
  delay: 5

- name: Restart sqfrontendd
  ansible.builtin.systemd:
    name: sqfrontendd
    state: restarted
  register: sqfrontendd_restarted
  until: sqfrontendd_restarted is succeeded
  retries: 3
  delay: 5

- name: Restart sqindexmanagerd
  ansible.builtin.systemd:
    name: sqindexmanagerd
    state: restarted
  register: sqindexmanagerd_restarted
  until: sqindexmanagerd_restarted is succeeded
  retries: 3
  delay: 5

- name: Restart sqingesterd
  ansible.builtin.systemd:
    name: sqingesterd
    state: restarted
  register: sqingesterd_restarted
  until: sqingesterd_restarted is succeeded
  retries: 3
  delay: 5

- name: Restart sqmachinelearningd
  ansible.builtin.systemd:
    name: sqmachinelearningd
    state: restarted
  register: sqmachinelearningd_restarted
  until: sqmachinelearningd_restarted is succeeded
  retries: 3
  delay: 5

- name: Restart sqnotesd
  ansible.builtin.systemd:
    name: sqnotesd
    state: restarted
  register: sqnotesd_restarted
  until: sqnotesd_restarted is succeeded
  retries: 3
  delay: 5

- name: Restart sqpdfconversiond
  ansible.builtin.systemd:
    name: sqpdfconversiond
    state: restarted
  register: sqpdfconversiond_restarted
  until: sqpdfconversiond_restarted is succeeded
  retries: 3
  delay: 5

- name: Restart sqplumberd
  ansible.builtin.systemd:
    name: sqplumberd
    state: restarted
  register: sqplumberd_restarted
  until: sqplumberd_restarted is succeeded
  retries: 3
  delay: 5

- name: Restart sqproviderd
  ansible.builtin.systemd:
    name: sqproviderd
    state: restarted
  register: sqproviderd_restarted
  until: sqproviderd_restarted is succeeded
  retries: 3
  delay: 5

- name: Restart sqrelatedstoryd
  ansible.builtin.systemd:
    name: sqrelatedstoryd
    state: restarted
  register: sqrelatedstoryd_restarted
  until: sqrelatedstoryd_restarted is succeeded
  retries: 3
  delay: 5

- name: Restart sqschedulerd
  ansible.builtin.systemd:
    name: sqschedulerd
    state: restarted
  register: sqschedulerd_restarted
  until: sqschedulerd_restarted is succeeded
  retries: 3
  delay: 5

- name: Restart sqsearchd
  ansible.builtin.systemd:
    name: sqsearchd
    state: restarted
  register: sqsearchd_restarted
  until: sqsearchd_restarted is succeeded
  retries: 3
  delay: 5

- name: Restart sqthumblerd
  ansible.builtin.systemd:
    name: sqthumblerd
    state: restarted
  register: sqthumblerd_restarted
  until: sqthumblerd_restarted is succeeded
  retries: 3
  delay: 5

- name: Restart sqtopicproxyd
  ansible.builtin.systemd:
    name: sqtopicproxyd
    state: restarted
  register: sqtopicproxyd_restarted
  until: sqtopicproxyd_restarted is succeeded
  retries: 3
  delay: 5

- name: Restart sqtrendsd
  ansible.builtin.systemd:
    name: sqtrendsd
    state: restarted
  register: sqtrendsd_restarted
  until: sqtrendsd_restarted is succeeded
  retries: 3
  delay: 5

- name: Restart sqtopicd
  ansible.builtin.systemd:
    name: sqtopicd
    state: restarted
  register: sqtopicd_restarted
  until: sqtopicd_restarted is succeeded
  retries: 3
  delay: 5

- name: Restart squserproxyd
  ansible.builtin.systemd:
    name: squserproxyd
    state: restarted
  register: squserproxyd_restarted
  until: squserproxyd_restarted is succeeded
  retries: 3
  delay: 5

- name: Restart squserd
  ansible.builtin.systemd:
    name: squserd
    state: restarted
  register: squserd_restarted
  until: squserd_restarted is succeeded
  retries: 3
  delay: 5

- name: Restart sqwebshotd
  ansible.builtin.systemd:
    name: sqwebshotd
    state: restarted
  register: sqwebshotd_restarted
  until: sqwebshotd_restarted is succeeded
  retries: 3
  delay: 5
