Skip to content

unattended-upgrade: Use internal distro_codename variable

No need to expand it and hard-code it apparently. This has the benefit to avoid having to deal with multiple distributions within the puppet manifest (due to our current migration).

Related to T3749 Related to migrated/migration$1212 (after an upgrade to bullseye within vagrant and diffing that config file)

Test Plan

Actual equivalent change on worker0.internal.staging.swh.network does not seem to disturb the unattended-upgrade cli call as well.

octo-diff:

$SWH_PUPPET_ENVIRONMENT_HOME/bin/octocatalog-diff --octocatalog-diff-args --no-truncate-details --to staging rp1.internal.admin.swh.network
...
*** Running octocatalog-diff on host rp1.internal.admin.swh.network
I, [2021-11-24T12:06:39.781370 #1048624]  INFO -- : Catalogs compiled for rp1.internal.admin.swh.network
I, [2021-11-24T12:06:40.088522 #1048624]  INFO -- : Diffs computed for rp1.internal.admin.swh.network
diff origin/production/rp1.internal.admin.swh.network current/rp1.internal.admin.swh.network
*******************************************
  Apt::Conf[unattended-upgrades] =>
   parameters =>
     content =>
      @@ -5,10 +5,10 @@
       // pocket these get automatically pulled in.
       Unattended-Upgrade::Origins-Pattern {
      - "o=Debian,n=buster";
      - "o=Debian,n=buster-updates";
      - "o=Debian,n=buster,l=Debian-Security";
      - "o=debian icinga-buster,n=icinga-buster";
      - "o=Debian Azure,n=buster";
      - "o=Proxmox,n=buster";
      + "o=Debian,codename=${distro_codename}";
      + "o=Debian,codename=${distro_codename}-updates";
      + "o=Debian,codename=${distro_codename},l=Debian-Security";
      + "o=debian icinga-stable,codename=icinga-${distro-codename}";
      + "o=Debian Azure,codename=${distro_codename}";
      + "o=Proxmox,codename=${distro_codename}";
        "o=packages.sury.org";
       };
*******************************************
  Apt::Setting[conf-unattended-upgrades] =>
   parameters =>
     content =>
      @@ -6,10 +6,10 @@
       // pocket these get automatically pulled in.
       Unattended-Upgrade::Origins-Pattern {
      - "o=Debian,n=buster";
      - "o=Debian,n=buster-updates";
      - "o=Debian,n=buster,l=Debian-Security";
      - "o=debian icinga-buster,n=icinga-buster";
      - "o=Debian Azure,n=buster";
      - "o=Proxmox,n=buster";
      + "o=Debian,codename=${distro_codename}";
      + "o=Debian,codename=${distro_codename}-updates";
      + "o=Debian,codename=${distro_codename},l=Debian-Security";
      + "o=debian icinga-stable,codename=icinga-${distro-codename}";
      + "o=Debian Azure,codename=${distro_codename}";
      + "o=Proxmox,codename=${distro_codename}";
        "o=packages.sury.org";
       };
*******************************************
  File[/etc/apt/apt.conf.d/50unattended-upgrades] =>
   parameters =>
     content =>
      @@ -6,10 +6,10 @@
       // pocket these get automatically pulled in.
       Unattended-Upgrade::Origins-Pattern {
      - "o=Debian,n=buster";
      - "o=Debian,n=buster-updates";
      - "o=Debian,n=buster,l=Debian-Security";
      - "o=debian icinga-buster,n=icinga-buster";
      - "o=Debian Azure,n=buster";
      - "o=Proxmox,n=buster";
      + "o=Debian,codename=${distro_codename}";
      + "o=Debian,codename=${distro_codename}-updates";
      + "o=Debian,codename=${distro_codename},l=Debian-Security";
      + "o=debian icinga-stable,codename=icinga-${distro-codename}";
      + "o=Debian Azure,codename=${distro_codename}";
      + "o=Proxmox,codename=${distro_codename}";
        "o=packages.sury.org";
       };
*******************************************
*** End octocatalog-diff on rp1.internal.admin.swh.network

Migrated from D6683 (view on Phabricator)

Merge request reports