[PATCH] Add playbook to remove someone from denyhosts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 playbooks/denyhosts.yml | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 playbooks/denyhosts.yml

diff --git a/playbooks/denyhosts.yml b/playbooks/denyhosts.yml
new file mode 100644
index 0000000..0aa44be
--- /dev/null
+++ b/playbooks/denyhosts.yml
@@ -0,0 +1,28 @@
+# requires --extra-vars="target=somevhost ip=10.0.0.1"
+
+#General overview:
+# host provided via ``target`` argument on the CLI
+# IP provided via ``ip`` argument on the CLI
+# Log onto $target
+# remove $ip from /var/lib/denyhosts/*
+# remove $ip from /etc/hosts.deny
+# restart denyhosts
+
+# sop: http://infrastructure.fedoraproject.org/infra/docs/denyhosts.txt
+
+- name: Unban an IP from denyhosts
+  hosts: $target
+  user: root
+  serial: 1
+
+  tasks:
+  - name: Remove IP from /var/lib/denyhosts/*
+    action: command sed -si "/$ip/d" /var/lib/denyhosts/*
+    notify:
+    - restart denyhosts
+
+  - name: Remove IP from /etc/hosts.deny
+    action: command sed -si "/$ip/d" /etc/hosts.deny
+    notify:
+    - restart denyhosts
+
-- 
1.8.3.1

_______________________________________________
infrastructure mailing list
infrastructure@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/infrastructure





[Index of Archives]     [Fedora Development]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux