From bec22573974f7851c141327b749fee980f5e7fdd Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Wed, 28 Sep 2016 16:05:18 -0400 Subject: [PATCH] repos: configure RDO Virtualization repository Introduce manage_virt boolean (True by default) to whether or not configure RDO CentOS QEMU EV repository, required when deploying OpenStack Newton with RDO repositories. Change-Id: If62801a4975039714d9986a548b2144e448e00f7 --- files/RPM-GPG-KEY-CentOS-SIG-Virtualization | 20 +++++++++++++ manifests/repo/redhat/redhat.pp | 25 +++++++++++++++++ .../notes/rdo-virt-a9fb3681cbc8419e.yaml | 6 ++++ ...penstack_extras_repo_redhat_redhat_spec.rb | 28 +++++++++++++++++++ 4 files changed, 79 insertions(+) create mode 100644 files/RPM-GPG-KEY-CentOS-SIG-Virtualization create mode 100644 releasenotes/notes/rdo-virt-a9fb3681cbc8419e.yaml diff --git a/files/RPM-GPG-KEY-CentOS-SIG-Virtualization b/files/RPM-GPG-KEY-CentOS-SIG-Virtualization new file mode 100644 index 0000000..00006eb --- /dev/null +++ b/files/RPM-GPG-KEY-CentOS-SIG-Virtualization @@ -0,0 +1,20 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v2.0.22 (GNU/Linux) + +mQENBFWB31YBCAC4dFmTzBDOcq4R1RbvQXLkyYfF+yXcsMA5kwZy7kjxnFqBoNPv +aAjFm3e5huTw2BMZW0viLGJrHZGnsXsE5iNmzom2UgCtrvcG2f65OFGlC1HZ3ajA +8ZIfdgNQkPpor61xqBCLzIsp55A7YuPNDvatk/+MqGdNv8Ug7iVmhQvI0p1bbaZR +0GuavmC5EZ/+mDlZ2kHIQOUoInHqLJaX7iw46iLRUnvJ1vATOzTnKidoFapjhzIt +i4ZSIRaalyJ4sT+oX4CoRzerNnUtIe2k9Hw6cEu4YKGCO7nnuXjMKz7Nz5GgP2Ou +zIA/fcOmQkSGcn7FoXybWJ8DqBExvkJuDljPABEBAAG0bENlbnRPUyBWaXJ0dWFs +aXphdGlvbiBTSUcgKGh0dHA6Ly93aWtpLmNlbnRvcy5vcmcvU3BlY2lhbEludGVy +ZXN0R3JvdXAvVmlydHVhbGl6YXRpb24pIDxzZWN1cml0eUBjZW50b3Mub3JnPokB +OQQTAQIAIwUCVYHfVgIbAwcLCQgHAwIBBhUIAgkKCwQWAgMBAh4BAheAAAoJEHrr +voJh6IBsRd0H/A62i5CqfftuySOCE95xMxZRw8+voWO84QS9zYvDEnzcEQpNnHyo +FNZTpKOghIDtETWxzpY2ThLixcZOTubT+6hUL1n+cuLDVMu4OVXBPoUkRy56defc +qkWR+UVwQitmlq1ngzwmqVZaB8Hf/mFZiB3B3Jr4dvVgWXRv58jcXFOPb8DdUoAc +S3u/FLvri92lCaXu08p8YSpFOfT5T55kFICeneqETNYS2E3iKLipHFOLh7EWGM5b +Wsr7o0r+KltI4Ehy/TjvNX16fa/t9p5pUs8rKyG8SZndxJCsk0MW55G9HFvQ0FmP +A6vX9WQmbP+ml7jsUxtEJ6MOGJ39jmaUvPc= +=ZzP+ +-----END PGP PUBLIC KEY BLOCK----- diff --git a/manifests/repo/redhat/redhat.pp b/manifests/repo/redhat/redhat.pp index 69658dc..3b4554f 100644 --- a/manifests/repo/redhat/redhat.pp +++ b/manifests/repo/redhat/redhat.pp @@ -14,6 +14,12 @@ # for the RDO OpenStack repository provided by RedHat # Defaults to true # +# [*manage_virt*] +# (optional) Whether to create a predefined yumrepo resource +# for the RDO CentOS QEMU EV epository provided by RedHat. +# This repository has been required starting from Newton. +# Defaults to true +# # [*manage_epel*] # (optional) Whether to create a predefined yumrepo resource # for the EPEL repository provided by RedHat @@ -62,6 +68,7 @@ class openstack_extras::repo::redhat::redhat( $release = $::openstack_extras::repo::redhat::params::release, $manage_rdo = true, + $manage_virt = true, $manage_epel = false, $repo_hash = {}, $repo_defaults = {}, @@ -109,6 +116,24 @@ class openstack_extras::repo::redhat::redhat( create_resources('yumrepo', $rdo_hash, $_repo_defaults) } + if $manage_virt { + $virt_hash = { + 'rdo-qemu-ev' => { + 'baseurl' => "${centos_mirror_url}/centos/7/virt/\$basearch/kvm-common/", + 'descr' => 'RDO CentOS-7 - QEMU EV', + 'gpgkey' => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization', + } + } + + $virtkey_hash = { '/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization' => { + 'source' => 'puppet:///modules/openstack_extras/RPM-GPG-KEY-CentOS-SIG-Virtualization' + } + } + + create_resources('file', $virtkey_hash, $_gpgkey_defaults) + create_resources('yumrepo', $virt_hash, $_repo_defaults) + } + if $manage_epel { if ($::osfamily == 'RedHat' and $::operatingsystem != 'Fedora') diff --git a/releasenotes/notes/rdo-virt-a9fb3681cbc8419e.yaml b/releasenotes/notes/rdo-virt-a9fb3681cbc8419e.yaml new file mode 100644 index 0000000..ecb4df6 --- /dev/null +++ b/releasenotes/notes/rdo-virt-a9fb3681cbc8419e.yaml @@ -0,0 +1,6 @@ +--- +features: + - With a new boolean called manage_virt, allow to whether or not activate + RDO CentOS QEMU EV repository that is required when deploying OpenStack + Newton with RDO packaging. It's enabled by default to make deployments + working out of the box, but can be disabled. diff --git a/spec/classes/openstack_extras_repo_redhat_redhat_spec.rb b/spec/classes/openstack_extras_repo_redhat_redhat_spec.rb index 1dee33d..5659f75 100644 --- a/spec/classes/openstack_extras_repo_redhat_redhat_spec.rb +++ b/spec/classes/openstack_extras_repo_redhat_redhat_spec.rb @@ -61,6 +61,17 @@ describe 'openstack_extras::repo::redhat::redhat' do :notify => "Exec[yum_refresh]" )} + it { is_expected.to contain_yumrepo('rdo-qemu-ev').with( + :baseurl => "http://mirror.centos.org/centos/7/virt/$basearch/kvm-common/", + :descr => "RDO CentOS-7 - QEMU EV", + :gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization", + :enabled => '1', + :gpgcheck => '1', + :mirrorlist => 'absent', + :require => "Anchor[openstack_extras_redhat]", + :notify => "Exec[yum_refresh]" + )} + it { is_expected.to contain_exec('installing_yum-plugin-priorities').with( :command => '/usr/bin/yum install -y yum-plugin-priorities', :logoutput => 'on_failure', @@ -104,6 +115,14 @@ describe 'openstack_extras::repo::redhat::redhat' do :before => "Anchor[openstack_extras_redhat]" )} + it { is_expected.to contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization').with( + :source => "puppet:///modules/openstack_extras/RPM-GPG-KEY-CentOS-SIG-Virtualization", + :owner => 'root', + :group => 'root', + :mode => '0644', + :before => "Anchor[openstack_extras_redhat]" + )} + end describe 'with overridden release' do @@ -208,6 +227,15 @@ describe 'openstack_extras::repo::redhat::redhat' do it { is_expected.to_not contain_yumrepo('rdo-release') } end + + describe 'with rdo-virt management disabled' do + let :params do + default_params.merge!({ :manage_virt => false }) + end + + it { is_expected.to_not contain_yumrepo('rdo-qemu-ev') } + end + describe 'with manage_priorities disabled' do let :params do default_params.merge!({ :manage_priorities => false })