Skip to content

Bugfix - sources format and ensure => absent fails#1243

Open
traylenator wants to merge 2 commits intopuppetlabs:mainfrom
traylenator:absent_sources
Open

Bugfix - sources format and ensure => absent fails#1243
traylenator wants to merge 2 commits intopuppetlabs:mainfrom
traylenator:absent_sources

Conversation

@traylenator
Copy link

@traylenator traylenator commented Aug 15, 2025

Summary

apt::source{
  ensure        => absent,
  source_format => sources,
}

produces a compile error every time.

    Puppet::PreformattedError:
       Evaluation Error: Error while evaluating a Resource Statement, Apt::Setting[sources-my_source]: parameter 'content' expects a value of type Undef or String[1], got String (file: /home/steve/GIT/puppetlabs-apt/spec/fixtures/modules/apt/manifests/source.pp, line: 363) on node legion.lan

@traylenator traylenator requested review from a team, bastelfreak and smortex as code owners August 15, 2025 08:52
traylenator added a commit to traylenator/puppet-cvmfs that referenced this pull request Aug 15, 2025
@traylenator traylenator changed the title sources format and ensure => absent fails Bugfix - sources format and ensure => absent fails Oct 4, 2025
Currently  the following produces a compile error every time.

```puppet
apt::source{
  ensure        => absent,
  source_format => sources,
}
```

```
    Puppet::PreformattedError:
       Evaluation Error: Error while evaluating a Resource Statement, Apt::Setting[sources-my_source]: parameter 'content' expects a value of type Undef or String[1], got String (file: /home/steve/GIT/puppetlabs-apt/spec/fixtures/modules/apt/manifests/source.pp, line: 363) on node legion.lan
```
@traylenator
Copy link
Author

traylenator commented Feb 7, 2026

As a workaround which is reasonable, while

apt::source{
  ensure => absent,
  source_format => sources,
}

fails

apt::source{
  ensure => enabled,
  source_format  => sources,
  enabled  => false,
} 

achieves practically the same result.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants