Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-2865

Puppet wipes "/etc/hosts" if any entry cannot be parsed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Duplicate
    • Affects Version/s: PUP 2.7.25, PUP 3.6.1
    • Fix Version/s: None
    • Component/s: Types and Providers
    • Labels:
      None
    • Template:

      Description

      If any entry in "/etc/hosts" is unparsable and a "host" entity is created, Puppet will add the "host" entry to a blank "/etc/hosts" file thus deleting the actual contents of the "/etc/hosts" file.

      Simple demonstration:
      root@host# wc -l /etc/hosts
      37 /etc/hosts
      root@host# echo ' 1.0.0.1 test-93bc213cf5e6bc992791e6002e296b594b9650b2' >> /etc/hosts
      root@host# puppet apply --verbose --execute 'host

      {'test1-93bc213cf5e6bc992791e6002e296b594b9650b2': ensure=> present, ip => "1.0.0.2" }

      '
      ...
      err: Could not prefetch host provider 'parsed': Could not parse line " 1.0.0.1 test-93bc213cf5e6bc992791e6002e296b594b9650b2" at /etc/hosts:38
      ...
      root@host# wc -l /etc/hosts
      4 /etc/hosts
      root@host#

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              kylo Kylo Ginsberg
              Reporter:
              rkeene R K
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support