<% if profile.include? 'master_ip' -%>
#cloud-config
runcmd:
 - echo "<%= profile['master_ip'] %>  master.puppetlabs.vm master puppet" >> /etc/hosts

powershell: |
 <powershell>
  $file = "$env:windir\System32\drivers\etc\hosts"
  "<%= profile['master_ip'] %>  master.puppetlabs.vm master puppet" | Add-Content -PassThru $file
 </powershell>
<% end -%>

<% if profile.include? 'master_ip' -%>
#cloud-config
runcmd:
 - echo "<%= profile['master_ip'] %>  master.puppetlabs.vm master puppet" >> /etc/hosts

powershell: |
 <powershell>
  $file = "$env:windir\System32\drivers\etc\hosts"
  "\n<%= profile['master_ip'] %>  master.puppetlabs.vm master puppet" | Add-Content -PassThru $file
 </powershell>
<% end -%>

Add newline to hosts file
Add newline to hosts file

The Windows default hosts file doesn't appear to end with a newline, so let's add one.

TRAINTECH-1599 #resolved #time 10m