Ansible playbook that you can use to control ssh access to your linux servers. You can install or remove keys, tune sshd options and install additional software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ssh-keys.yml 801B

123456789101112131415161718192021222324252627282930313233343536
  1. ---
  2. # Check if python2 installed to server
  3. - name: Checkout python2
  4. hosts: all
  5. ignore_errors: yes
  6. vars:
  7. ansible_python_interpreter: /usr/bin/python3
  8. roles:
  9. # install python 2 and pip, use only for python3-only hosts
  10. #- python2
  11. # Ok, now magic begins
  12. - hosts: all
  13. gather_facts: True
  14. roles:
  15. # use master key only if you realy want it
  16. # playbook install it only for root and delete others! allow root auth with key
  17. #- master_key
  18. # upgrade pip before python libs installation in preinstall role
  19. #- upgrade_pip
  20. # preinstall required libs and apps before first server use
  21. #- preinstall
  22. # this role reconfigures sshd server
  23. - ssh_config
  24. # add/remove public keys from servers
  25. - ssh_access
  26. # create ssh tunnels
  27. #- ssh_tunnel