This file is indexed.

/var/lib/cobbler/snippets/hosts.xml is in maas-provision-common 2.2.2-0ubuntu4.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<host>
  <hosts config:type="list">
    <hosts_entry>
      <host_address>127.0.0.1</host_address>
      <names config:type="list">
        <name>localhost</name>
      </names>
    </hosts_entry>
    #set $ikeys = $interfaces.keys()
    #for $iface in $ikeys
    #set $idata = $interfaces[$iface]
    #if $idata["interface_type"].lower() in ["","na","bridge","bond"]
    <hosts_entry>
      <host_address>$idata["ip_address"]</host_address>
      <names config:type="list">
        #set $my_interface_hostname_short = $idata["dns_name"].split('.',1)[:1][0]
        <name>$idata["dns_name"].lower() $my_interface_hostname_short.lower()</name>
      </names>
    </hosts_entry>
    #end if
    #end for
  </hosts>
</host>