title: Create bash script to create yaml files from existing linux etc/hosts files
body: <p>I'm new to scripting but have been tasked with creating yaml files from existing Linux /etc/hosts files. Using a hosts file here:</p>
  
  <pre><code>127.0.0.1      localhost
  192.168.1.2    host1
  192.168.1.3    host2
  192.168.1.4    host3
  192.168.1.5    host4
  </code></pre>
  
  <p>..to create yaml files that look like this:</p>
  
  <pre><code>host_entries:
    host1:
      ip: '192.168.1.2'
    host2:
      ip: '192.168.1.3'
    host3:
      ip: '192.168.1.4'
    host4:
      ip: '192.168.1.5'
  </code></pre>
  
  <p>I know there is more than one way to reach a desired solution. But I'm not quite sure how to script this in a way to get the correct format. Any suggestions would be appreciated.</p>