# HG changeset patch # User IBBoard # Date 1639687078 0 # Node ID f9a6f6ff8256f91b2623a81bbf50796ec4dcafca # Parent 308b4149bee538ddb44e94b1c7995c7fdb209b55 Attempt to migrate CentOS8 to Streams automatically diff -r 308b4149bee5 -r f9a6f6ff8256 manifests/templates.pp --- a/manifests/templates.pp Sun Nov 21 17:09:18 2021 +0000 +++ b/manifests/templates.pp Thu Dec 16 20:37:58 2021 +0000 @@ -255,6 +255,19 @@ if $operatingsystem == 'CentOS' and versioncmp($operatingsystemrelease, '8') >= 0 { $python_ver = 'python3' + + # The following may possibly work to ensure a CentOS Streams install. + # Or it might fail for inexplicable reasons. + # FIXME: Should be "centos-release-stream" to migrate (provides repos), but then that gets replaced by centos-stream-release, + # which Puppet doesn't recognise as the same and so keeps trying to re-install. May need an "unless" or maybe "allow_virtual" + package { 'centos-stream-release': + ensure => installed, + notify => Exec['migrate to streams']; + } + exec { 'migrate to streams': + command => '/usr/bin/dnf swap centos-linux-repos centos-stream-repos; /usr/bin/dnf distro-sync -y', + refreshonly => true + } } else { $python_ver = 'system' }