]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
public_facing: Disable PasswordAuthentication in sshd config 307/head
authorDavid Galloway <dgallowa@redhat.com>
Tue, 21 Feb 2017 22:43:26 +0000 (17:43 -0500)
committerDavid Galloway <dgallowa@redhat.com>
Wed, 1 Mar 2017 23:39:34 +0000 (18:39 -0500)
Signed-off-by: David Galloway <dgallowa@redhat.com>
roles/public_facing/handlers/main.yml
roles/public_facing/tasks/main.yml

index 99bcd684823a2413de71ff9bb66701cb775b78d8..d548b28c530e7f20d8bf77417402491a34758a9a 100644 (file)
@@ -10,3 +10,9 @@
   service:
     name: fail2ban
     state: reloaded
+
+# Restart sshd
+- name: restart sshd
+  service:
+    name: sshd
+    state: restarted
index 7be38dbb1ffe9f6da65143dd190cd96d8c1c98db..6e215de4819688de22fde76cd4843e2f104fc785 100644 (file)
     - always
   when: use_fail2ban == true
 
+- name: Disable password authentication
+  lineinfile:
+    dest: /etc/ssh/sshd_config
+    regexp: "^PasswordAuthentication"
+    line: "PasswordAuthentication no"
+    state: present
+  notify: restart sshd
+
 ## Individual host tasks
 
 # local_action in the task after this causes 'ansible_host' to change to 'localhost'