--- - hosts: clientes user: root tasks: - name: restart apache en debian service: name: apache2 state: started enabled: yes when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' - name: restart httpd en centos service: name: httpd state: started enabled: yes when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux' ...