main.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # Copyright 2022 Dell Inc. or its subsidiaries. All Rights Reserved.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. ---
  15. - name: Set Facts
  16. set_fact:
  17. ansible_ssh_common_args: '-o StrictHostKeyChecking=no'
  18. - name: Disable host key checking
  19. replace:
  20. path: /etc/ssh/ssh_config
  21. regexp: '# StrictHostKeyChecking ask'
  22. replace: 'StrictHostKeyChecking no'
  23. - name: Disable strict mode checking
  24. replace:
  25. path: /etc/ssh/ssh_config
  26. regexp: '^StrictModes\ '
  27. replace: 'StrictModes no'
  28. - name: Restart sshd
  29. service:
  30. name: sshd
  31. state: restarted
  32. - name: Install sshpass
  33. package:
  34. name: sshpass
  35. state: present
  36. - name: Verify and set passwordless ssh from manager to compute nodes
  37. block:
  38. - name: Execute on individual hosts
  39. include_tasks: passwordless_ssh.yml
  40. with_items: "{{ ssh_to }}"
  41. loop_control:
  42. pause: 5