--- - hosts: all - become: true tasks: - name: Installs fail2ban apt: pkg=fail2ban state=installed update_cache=true - name: download allow file get_url: url: https://git.aanetworks.org/ariel/playbook-base/src/branch/master/static_files/hosts.allow dest: /tmp/hosts.allow - name: downlod deny file get_url: url: https://git.aanetworks.org/ariel/playbook-base/src/branch/master/static_files/hosts.deny dest: /tmp/hosts.deny - name: Hosts file Deny copy: src=/tmp/hosts.deny dest=/etc/hosts.deny - name: Hosts file Allow copy: src=/tmp/hosts.allow dest=/etc/hosts.allow handlers: - name: start fail2ban service: name=fail2ban state=started