---
# tasks file

- name: Main... Show Selinux variable
  debug: var=ansible_selinux

- name: Main... collect facts about system services
  service_facts:
  register: services_state

- name: Set my_redis_service host variable
  set_fact:
    my_redis_service: "{{ ansible_facts.services['%s.service' % (redis_daemon)] }}"
  when: ('%s.service' % (redis_daemon)) in ansible_facts.services.keys()

- name: Check Redis status
  debug:
    var: my_redis_service

- include_tasks: "web/{{ ansible_os_family }}.yml"

- include_tasks: "php/{{ ansible_os_family }}.yml"

  #- include_tasks: "ssl.yml"

- name: Main... Check Selinux
  include_tasks: "selinux.yml"
  when:
    - (ansible_os_family == "RedHat")
    - (ansible_selinux.status == "enabled")

- name: Main... Restart {{ http_service_name }} service
  service:
    name: "{{ http_service_name }}"
    state: restarted
