Skip to content

"Operator '[]' is not applicable to an Undef Value", at setting.pp #1269

@Turin86

Description

@Turin86

Describe the Bug

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Operator '[]' is not applicable to an Undef Value. (file: /etc/puppetlabs/code/environments/production/modules/apt/manifests/setting.pp, line: 58, column: 12) (file: /etc/puppetlabs/code/environments/production/manifests/classes/apt-unattended-upgrades.pp, line: 9)

Steps to Reproduce

#
class apt_unattended_upgrades {
  $packages = [
    'unattended-upgrades',
  ]
  package { $packages: ensure => installed } ->

  if $facts['os']['distro']['id'] in ['Debian', 'Ubuntu'] {
    apt::setting { 'conf-auto-upgrades':
      notify_update => false,
      priority      => 20,
      content       => "APT::Periodic::Update-Package-Lists \"1\";\nAPT::Periodic::Unattended-Upgrade \"1\";\nAPT::Periodic::MaxAge \"7\";\n",
    }
    apt::setting { 'conf-unattended-upgrades-background':
      notify_update => false,
      priority      => 61,
      content       => "Unattended-Upgrade::InstallOnShutdown \"false\";\n",
    }
    apt::setting { 'conf-unattended-upgrades-autoremove':
      notify_update => false,
      priority      => 62,
      content       => "Unattended-Upgrade::Remove-Unused-Dependencies \"true\";\n",
    }
  }
}

Environment

  • Puppetserver version: puppetserver version: 7.17.1
  • Puppet agent version: 8.10.0
  • Module: puppetlabs-apt (v9.4.0)
  • Platform: Debian GNU/Linux 12 (bookworm)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions