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.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 

35 行
758 B

  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