streda 16. februára 2022

script for check ansible hosts

basic script for check ansible hosts 




 #!/bin/bash


#script to check ansible hosts


# for communication with ssh we can ignore hostkeyChecking


#only condition: if .ssh/config is exists; that's ok and redirect to /dev/null ---if no exists --create file and redirect StrictHostKeyChecking no

cd ~


if test -e .ssh/config


then


echo ic do marii >> /dev/null


else


echo StrictHostKeyChecking no >> .ssh/config


fi


#check ansible hosts 

 ansible all -m ping


Žiadne komentáre:

Zverejnenie komentára