From 9d764f163125c9037b47f882994998de98d7fb18 Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Mon, 4 Jul 2016 11:50:43 -0400 Subject: [PATCH] Move reprepro bits to reprepro_mirror.pp This allow reprepro to become shared code, which is needed when we add reprepro into the post pipeline. Change-Id: Ia19ad4b1d0b770e93a8be27b4cb39d4d186cb8ac Signed-off-by: Paul Belanger --- .../manifests/mirror_update.pp | 25 +++---------------- .../manifests/reprepro_mirror.pp | 23 +++++++++++++++++ 2 files changed, 26 insertions(+), 22 deletions(-) create mode 100644 modules/openstack_project/manifests/reprepro_mirror.pp diff --git a/modules/openstack_project/manifests/mirror_update.pp b/modules/openstack_project/manifests/mirror_update.pp index 733532394b..4b4a21828d 100644 --- a/modules/openstack_project/manifests/mirror_update.pp +++ b/modules/openstack_project/manifests/mirror_update.pp @@ -9,6 +9,7 @@ class openstack_project::mirror_update ( $centos_keytab = '', $epel_keytab = '', ) { + include ::openstack_project::reprepro_mirror class { 'openstack_project::server': sysadmins => $sysadmins, @@ -96,24 +97,6 @@ class openstack_project::mirror_update ( ] } - # TODO(clarkb) this setup needs to go in a class of its own. It is not - # in the define because it is common to all reprepro mirrors. - package { 'reprepro': - ensure => present, - } - - file { '/var/log/reprepro': - ensure => directory, - } - - file { '/var/run/reprepro': - ensure => directory, - } - - file { '/etc/reprepro': - ensure => directory, - } - file { '/etc/reprepro.keytab': owner => 'root', group => 'root', @@ -129,10 +112,6 @@ class openstack_project::mirror_update ( source => 'puppet:///modules/openstack_project/reprepro/reprepro-mirror-update.sh', } - cron { 'reprepro': - ensure => absent, - } - ::openstack_project::reprepro { 'ubuntu-reprepro-mirror': confdir => '/etc/reprepro/ubuntu', basedir => '/afs/.openstack.org/mirror/ubuntu', @@ -285,4 +264,6 @@ class openstack_project::mirror_update ( key_type => 'public', key_source => 'puppet:///modules/openstack_project/reprepro/ubuntu-cloud-archive-gpg-key.asc', } + + } diff --git a/modules/openstack_project/manifests/reprepro_mirror.pp b/modules/openstack_project/manifests/reprepro_mirror.pp new file mode 100644 index 0000000000..5430b1c64a --- /dev/null +++ b/modules/openstack_project/manifests/reprepro_mirror.pp @@ -0,0 +1,23 @@ +# == Class: openstack_project::reprepro_mirror +# +class openstack_project::reprepro_mirror { + package { 'reprepro': + ensure => present, + } + + file { '/var/log/reprepro': + ensure => directory, + } + + file { '/var/run/reprepro': + ensure => directory, + } + + file { '/etc/reprepro': + ensure => directory, + } + + cron { 'reprepro': + ensure => absent, + } +}