Scripts that run ssh against fresh machines often end up with StrictHostKeyChecking no, because the yes/no question blocks them. There is a safer middle road.
The ssh_config man page lists the values. yes never adds host keys automatically and refuses hosts whose key changed. ask, the default, adds a new key only after you confirm it. no or off adds new keys by itself and lets connections to changed hosts go on, subject to some restrictions. accept-new adds new host keys automatically but does not permit connections to hosts with changed keys.
ssh -o StrictHostKeyChecking=accept-new [email protected] uptime
The first connection to a new host works without a question, and the key goes into known_hosts. Later connections are checked against it, and a changed key stops the connection. no gives up exactly that check.
For a group of hosts in your config:
Host lab-*
StrictHostKeyChecking accept-new
The weak spot is the first connection. accept-new trusts whatever answers the first time, so someone in the middle at that moment would be accepted for good. On my own LAN I find that risk small. For a machine across the internet I would check the fingerprint once through another route, such as the provider’s console, and stay on ask.
When a key changes for a good reason, a reinstall for example, ssh refuses until you remove the old entry with ssh-keygen -R.
Further reading: ssh_config(5)