summaryrefslogtreecommitdiff
path: root/playbooks/ssh.yaml
blob: 167a23500cc0f499859cc949da8794b21f33c270 (plain)
1
2
3
4
5
6
7
8
9
10
11
---
- name: "Configure ssh"
  shell: |
    if [ "$(grep -F 'UseDNS' /etc/ssh/sshd_config)" == "" ]; then
        echo "UseDNS no" | tee -a /etc/ssh/sshd_config
    else
        sed -e 's/^UseDNS.*$/UseDNS no/g' -i /etc/ssh/sshd_config
    fi
    sed -e 's/^SSHD_OPTS.*$/SSHD_OPTS="-u0"/g' -i /etc/default/ssh
  args:
    executable: /bin/bash