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

Edit several values of ini file with just one ini_setting resource

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: inifile
    • Labels:
      None
    • Template:

      Description

      Hi,

      It could be very cool if it was possible to edit several values of a section in a .ini file with just one ini_setting resource. Here is an example :

      # The values in the 'foo' section that I want to manage.
      $my_hash = {
                  'setting1' => 'value1',
                  'setting2' => 'value2',
                  'setting3' => 'value3',
                  'setting4' => 'value4',
                  'setting5' => 'value5',
                  'setting6' => 'value6',
                 }
       
      # Several values are managed with just one ini_setting resource.
      ini_setting { 'values-of-foo-section':
        ensure        => present,
        path          => '/my/file.ini',
        section       => 'foo',
        hash_settings => $my_hash, # <---- Here is the request. ;)
      }
      

      And after a puppet run, I have this in my .ini file

      ...
       
      [foo]
      setting1 = value1
      setting2 = value2
      setting3 = value3
      setting4 = value4
      setting5 = value5
      setting6 = value6
       
      ...
      

      This is just a feature request, I don't know if it's easy to implement.
      But it could be very practical.

      Regards.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              flaf Francois Lafont
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Zendesk Support