---
- name: prepare servers - Debian only
  hosts: borgbackup_servers
  gather_facts: true
  tasks:
    - name: start ssh - Debian Server
      command: service ssh start
# note: https://forums.docker.com/t/any-simple-and-safe-way-to-start-services-on-centos7-systemd/5695/8
# needs to be implemented
#   - name: start sshd
#     command: service sshd start

- name: prepare all
  hosts: all:!borgbackup_servers:!centos
  tasks:
    - name: Install required packages
      apt:
        name: "{{ item }}"
        state: installed
      with_items:
        - apache2
        - mysql-server
        - automysqlbackup

---
- name: prepare servers - Debian only
  hosts: borgbackup_servers
  gather_facts: true
  tasks:
    - name: start ssh - Debian Server
      command: service ssh start
# note: https://forums.docker.com/t/any-simple-and-safe-way-to-start-services-on-centos7-systemd/5695/8
# needs to be implemented
#   - name: start sshd
#     command: service sshd start

- name: prepare all
  hosts: all:!borgbackup_servers:!centos
  tasks:
    - name: Install required packages
      apt:
        name:
          - apache2
          - mysql-server
          - automysqlbackup
        state: present
      notify: start mysql
  handlers:
    - name: start mysql
      service:
        name: mysql
        state: started
        enabled: yes

Make sure mysql is started
Make sure mysql is started
