---
- name: Enable and restart all core services
  service:
    name: "{{ item }}"
    enabled: yes
    state: restarted
  with_items:
   - "influxdb"
   - "mysql"
   - "php7.4-fpm"
   - "nginx"
   - "redis"

- name: Pause to allow InfluxDB to spin up
  wait_for: port=8086 delay=5
---
- name: Set Redis service name
  set_fact:
    redis_service_name: "{{ 'redis-server' if ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'focal' else 'redis' }}"

- name: Enable and restart all core services
  service:
    name: "{{ item }}"
    enabled: yes
    state: restarted
  with_items:
    - "influxdb"
    - "mysql"
    - "php7.4-fpm"
    - "nginx"
    - "{{ redis_service_name }}"

- name: Pause to allow InfluxDB to spin up
  wait_for: port=8086 delay=5
Fix 20.04 service name in other task.
Fix 20.04 service name in other task.

