---
- name: Install Samba and packages on RedHat Family
  yum:
     name="{{ samba_packages }}"
     state=latest
  with_items: "{{ samba_packages }}"
- name: Insert firewalld rule for samba
  firewalld:
    service: samba
    permanent: true 
    state: enabled 
    immediate: yes
  ignore_errors: yes
- name: Start Chrony
  service: 
    name: chronyd
    state: started
    enabled: yes
- name: Start Samba
  service:
    name: smb.service
    state: started 
    enabled: yes
- name: Copy samba configuration
  template:
    src=snb.conf dest=/etc/samba/smb.conf
  notify:
    - samba restart
- name: Chrony reload
  command: systemctl restart chronyd


