ansible-roles/ubuntu-deb-general/tasks/denyhost.yml

36 lines
976 B
YAML

---
- name: install denyhosts on debian <=7 and ubuntu <= 12.04
apt: pkg={{ item }} state=installed
with_items:
- denyhosts
when:
- is_debian_7_or_older
- is_ubuntu_less_than_trusty
tags: denyhosts
- name: ensure CM can access the VMs
action: |
lineinfile name=/etc/hosts.allow regexp="sshd: 146.48.123.18$" line="sshd: 146.48.123.18"
when:
- is_debian_7_or_older
- is_ubuntu_less_than_trusty
tags: denyhosts
- name: ensure Monitoring can connect via ssh
action: |
lineinfile name=/etc/hosts.allow regexp="sshd: 146.48.123.23$" line="sshd: 146.48.123.23"
when:
- is_debian_7_or_older
- is_ubuntu_less_than_trusty
tags: denyhosts
- name: Set the treshold for root on the denyhosts config file
lineinfile: |
name=/etc/denyhosts.conf regexp="^DENY_THRESHOLD_ROOT = " line="DENY_THRESHOLD_ROOT = 5"
when:
- is_debian_7_or_older
- is_ubuntu_less_than_trusty
notify: Restart denyhosts
tags: denyhosts