Uploaded image for project: 'Modules'
  1. Modules
  2. MODULES-5003

puppetlabs-stdlib : file_line does not correct multiple lines where one line already contains correct value.

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • None
    • None
    • stdlib
    • None
    • Needs Assessment

    Description

      Basic Info
      Module Version:
      stdlib 4.17.0

      Puppet Version:
      2017.2.1

      OS Name/Version:
      Centos 6.8

      Using the following code

      file_line { "limits: disable core dumps":
      ensure => present,
      path => '/etc/security/limits.conf',
      line => "*\thard\tcore\t0",
      match => "^[ \t]*\*[ \t]+hard[ \t]+core[ \t]+.*",
      multiple => true,
      }
      

      Will correctly add the entry to '/etc/security/limits.conf' if it does not exist
      eg

      • hard core 0

      If the following lines exist

      • hard core 90
      • hard core 10
        it correctly corrects both lines to
      • hard core 0
      • hard core 0

      However if these lines exist in the file

      • hard core 90
      • hard core 0

      It incorrectly does nothing
      It should correct the first line

      Attachments

        Issue Links

          Activity

            People

              tp Thomas Honey
              neil.binney Neil Binney
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support