Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

puppet - ini remove

I am using puppet 4.5.3 and ini_setting module version 1.4.2. I need to be able to remove a stanza in an ini file. For example:

[header]
ip = '1.1.1.1'
hostname = 'myserver'
port = 80

I am able to remove each section of the ini file using the ensure => absent parameter but I cannot find a way to remove the stanza header, or preferably the whole thing in one command.

What I have left is

[header]

Does anyone know how this can be done? Unfortunately there are other stanzas in the same file that I need to keep so I cannot simply delete the file.

thanks,