disable_AgentForwarding.yaml 445 B

1234567891011121314
  1. ---
  2. - name: "Make sure AgentForwarding is disabled"
  3. hosts: all
  4. gather_facts: false
  5. become: true
  6. tasks:
  7. - name: "Use lineinfile module to make sure AllowAgentForwarding no is present"
  8. lineinfile:
  9. path: "/etc/ssh/sshd_config"
  10. regex: "^(#)?{{item.key}}"
  11. line: "{{item.key}} {{item.value}}"
  12. state: present
  13. loop:
  14. - { key: "AllowAgentForwarding", value: "no" }