---

- hosts: ztv_serv
  become: yes
  tasks:
    - name: Install latest version fail2ban
      apt: name=fail2ban state=latest

    - name: Update nginx config files
      template:
        src: templates/fail2ban/ssh.conf
        dest: "/etc/fail2ban/jail.d/ssh.conf"
      tags:
        - fail2ban
      notify: restart fail2ban

  handlers:
    - name: restart fail2ban
      service: name=fail2ban state=restarted

#- name: Install fail2ban
#  apt:
#     name: fail2ban
#     state: latest
 

##
#- name: Update nginx config files
#  become: true
#  template:
#    src: templates/nginx.conf
#    dest: "/etc/nginx/sites-available/default"
#  tags:
#    - nginx
#  notify: Restart Nginx

###
