comparison manifests/templates.pp @ 383:f9a6f6ff8256

Attempt to migrate CentOS8 to Streams automatically
author IBBoard <dev@ibboard.co.uk>
date Thu, 16 Dec 2021 20:37:58 +0000
parents 308b4149bee5
children 22e45bb5ea97
comparison
equal deleted inserted replaced
382:308b4149bee5 383:f9a6f6ff8256
253 ensure => absent, 253 ensure => absent,
254 } 254 }
255 255
256 if $operatingsystem == 'CentOS' and versioncmp($operatingsystemrelease, '8') >= 0 { 256 if $operatingsystem == 'CentOS' and versioncmp($operatingsystemrelease, '8') >= 0 {
257 $python_ver = 'python3' 257 $python_ver = 'python3'
258
259 # The following may possibly work to ensure a CentOS Streams install.
260 # Or it might fail for inexplicable reasons.
261 # FIXME: Should be "centos-release-stream" to migrate (provides repos), but then that gets replaced by centos-stream-release,
262 # which Puppet doesn't recognise as the same and so keeps trying to re-install. May need an "unless" or maybe "allow_virtual"
263 package { 'centos-stream-release':
264 ensure => installed,
265 notify => Exec['migrate to streams'];
266 }
267 exec { 'migrate to streams':
268 command => '/usr/bin/dnf swap centos-linux-repos centos-stream-repos; /usr/bin/dnf distro-sync -y',
269 refreshonly => true
270 }
258 } else { 271 } else {
259 $python_ver = 'system' 272 $python_ver = 'system'
260 } 273 }
261 274
262 class { 'python': 275 class { 'python':