Skip to content

Add new ini_section type#537

Open
smortex wants to merge 1 commit into
mainfrom
524-add-ini_section
Open

Add new ini_section type#537
smortex wants to merge 1 commit into
mainfrom
524-add-ini_section

Conversation

@smortex

@smortex smortex commented Apr 1, 2024

Copy link
Copy Markdown
Collaborator

In order to explicitly manage sections of an ini file regardless of their content, we introduce a new ini_section type. This make it possible to remove a whole section of an ini file, regardless of its content:

ini_section { 'remove puppet.conf agent section':
  ensure  => abent,
  path    => '/etc/puppetlabs/puppet/puppet.conf',
  section => 'agent',
}

Just like the ini_setting type, ini_section can be subclassed:

puppet_config { 'remove agent section':
  ensure  => abent,
  section => 'agent',
}

Fixes #524

@smortex smortex added this to the 7.0.0 milestone Apr 1, 2024
@smortex smortex added feature and removed community labels Apr 1, 2024
@smortex smortex force-pushed the 524-add-ini_section branch from 3541b95 to bf19405 Compare April 1, 2024 19:56
@smortex smortex force-pushed the 524-add-ini_section branch 2 times, most recently from 8894ed7 to fd331f1 Compare April 1, 2024 21:13
@Ramesh7 Ramesh7 force-pushed the 524-add-ini_section branch from fd331f1 to f50f681 Compare June 6, 2024 15:49
@skyamgarp

Copy link
Copy Markdown
Contributor

@smortex ,
Can you please rebase and fix the conflicts?

In order to explicitly manage sections of an ini file regardless of
their content, we introduce a new ini_section type.  This make it
possible to remove a whole section of an ini file, regardless of its
content:

```puppet
ini_section { 'remove puppet.conf agent section':
  ensure  => abent,
  path    => '/etc/puppetlabs/puppet/puppet.conf',
  section => 'agent',
}
```

Just like the ini_setting type, ini_section can be subclassed:

```puppet
puppet_config { 'remove agent section':
  ensure  => abent,
  section => 'agent',
}
```

Fixes #524
@smortex smortex force-pushed the 524-add-ini_section branch from f50f681 to 71663b8 Compare May 6, 2026 00:57
@smortex smortex marked this pull request as ready for review May 6, 2026 00:59
@smortex smortex requested review from a team, bastelfreak and ekohl as code owners May 6, 2026 00:59
@smortex

smortex commented May 6, 2026

Copy link
Copy Markdown
Collaborator Author

@smortex , Can you please rebase and fix the conflicts?

@skyamgarp Rebased and slightly adjusted for consistency with the other changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dangling section headers persist in INI files when sections contain whitespace

3 participants