If you're interested in automating an install of SolrCloud (Solr plus ZooKeeper) in IaaS patterns, then
this script may be of help
to you. It was written a while back, to target Solr 7, but the patterns should be broadly applicable to newer versions too. It shows a pattern for installing Java, ZooKeeper and Solr in multi-node cloud-mode either all on one machine, or across multiple machines.