Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge puppetlabs-mock and puppetlabs-pe-mock into puppetlabs-rpmbuilder

This commit merges these three closely related modules
into a single 'rpmbuilder' module.
  • Loading branch information...
commit e10fde3ed6410b31aa23ae2f4b8b83b70b96015a 1 parent 810f6d9
@whopper whopper authored
View
2  Modulefile
@@ -1,5 +1,5 @@
name 'puppetlabs-rpmbuilder'
-version '0.0.1'
+version '0.0.2'
source 'https://github.com/Whopper92/puppetlabs-rpmbuilder'
author 'Puppet Labs'
license 'Apache License 2.0'
View
6 README.md
@@ -8,14 +8,10 @@ RPM packages. Mock is the central package building tool utilized in this module.
By default, standard mock configurations are installed for package building for Enterprise
Linux 4, 5 and 6, as well as Fedora 15 and higher.
-The recommended 'puppet-module-mock' module provides configurations to build Puppet Labs RPM
+The puppetlabs::mock class provides configurations to build Puppet Labs RPM
packages for all of the previously stated distributions.
## Dependencies
Facter 1.6.3 or higher
puppet-module-epel
-
-## Recommended Modules
-
- puppetlabs-mock
View
2  manifests/init.pp
@@ -2,5 +2,5 @@
include rpmbuilder::repos
include rpmbuilder::packages::essential
include rpmbuilder::packages::extra
- include mock
+ include rpmbuilder::mock::puppetlabs_mocks
}
View
31 manifests/mock/pe_config.pp
@@ -0,0 +1,31 @@
+define rpmbuilder::mock::pe_config (
+ $config,
+ $build_root,
+ $target_arch,
+ $legal_host_arches = "'i386','i586','i686','x86_64'",
+ $chroot_setup_cmd = "install bash bzip2 coreutils cpio curl cvs diffutils\
+ fedpkg findutils gawk gcc gcc-c++ gnupg grep gzip info make patch redhat-release\
+ redhat-release-server redhat-rpm-config rpm-build sed shadow-utils tar unzip\
+ util-linux-ng which xz buildsys-macros",
+ $dist,
+ $ccache_enable = 'False',
+ $dist_macro = undef,
+ $base_repo_baseurl = undef,
+ $base_mirrorlist = undef,
+ $updates_repo_baseurl = undef,
+ $updates_repo_enabled = '1',
+ $updates_mirrorlist = undef,
+ $pe_repo_baseurl,
+ $extras_repo_baseurl = undef,
+ $failover_priority = undef,
+) {
+
+ file { "${config}":
+ ensure => present,
+ mode => '0644',
+ owner => 'root',
+ group => 'root',
+ content => template("pe_mock/pupent-mock-config.erb"),
+ require => Package['mock'],
+ }
+}
View
299 manifests/mock/pe_mocks.pp
@@ -0,0 +1,299 @@
+class rpmbuilder::mock::pe_config {
+
+ $mock_path = '/etc/mock'
+ Package['mock'] -> Rpmbuilder::Mock::Pe_mocks<| |>
+
+ rpmbuilder::mock::pe_config { 'pupent-1.1-el4-i386-cve.cfg':
+ config => "${mock_path}/pupent-1.1-el4-i386-cve.cfg",
+ build_root => 'pupent-1.1-el4-i386-cve',
+ target_arch => 'i386',
+ dist => 'el4',
+ dist_macro => '.el4',
+ base_repo_baseurl => 'http://vault.centos.org/4.9/os/i386',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.1/repos/el-4-i386',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-1.1-el4-x86_64-cve.cfg':
+ config => "${mock_path}/pupent-1.1-el4-x86_64-cve.cfg",
+ build_root => 'pupent-1.1-el4-x86_64-cve',
+ target_arch => 'x86_64',
+ dist => 'el4',
+ dist_macro => '.el4',
+ base_repo_baseurl => 'http://vault.centos.org/4.9/os/x86_64/',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.1/repos/el-4-x86_64',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-1.1-el5-i386-cve.cfg':
+ config => "${mock_path}/pupent-1.1-el5-i386-cve.cfg",
+ build_root => 'pupent-1.1-el5-i386-cve',
+ target_arch => 'i386',
+ dist => 'el5',
+ dist_macro => '.el5',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent5latestserver-i386/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.1/repos/el-5-i386/',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-1.1-el5-x86_64-cve.cfg':
+ config => "${mock_path}/pupent-1.1-el5-x86_64-cve.cfg",
+ build_root => 'pupent-1.1-el5-x86_64-cve',
+ target_arch => 'x86_64',
+ dist => 'el5',
+ dist_macro => '.el5',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent5latestserver-x86_64/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.1/repos/el-5-x86_64',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-1.1-el6-i386-cve.cfg':
+ config => "${mock_path}/pupent-1.1-el6-i386-cve.cfg",
+ build_root => 'pupent-1.1-el6-i386-cve',
+ target_arch => 'i386',
+ dist => 'el6',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent6latestserver-i386/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.1/repos/el-6-i386',
+ failover_priority => 'base',
+ }
+ rpmbuilder::mock::pe_config { 'pupent-1.1-el6-x86_64-cve.cfg':
+ config => "${mock_path}/pupent-1.1-el6-x86_64-cve.cfg",
+ build_root => 'pupent-1.1-el6-x86_64-cve',
+ target_arch => 'x86_64',
+ dist => 'el6',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent6latestserver-x86_64/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.1/repos/el-6-x86_64',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-1.2-el4-i386-cve.cfg':
+ config => "${mock_path}/pupent-1.2-el4-i386-cve.cfg",
+ build_root => 'pupent-1.2-el4-i386-cve',
+ target_arch => 'i386',
+ dist => 'el4',
+ dist_macro => '.el4',
+ base_repo_baseurl => 'http://vault.centos.org/4.9/os/i386',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.2/repos/el-4-i386',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-1.2-el4-x86_64-cve.cfg':
+ config => "${mock_path}/pupent-1.2-el4-x86_64-cve.cfg",
+ build_root => 'pupent-1.2-el4-x86_64-cve',
+ target_arch => 'x86_64',
+ dist => 'el4',
+ dist_macro => '.el4',
+ base_repo_baseurl => 'http://vault.centos.org/4.9/os/x86_64/',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.2/repos/el-4-x86_64',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-1.2-el5-i386-cve.cfg':
+ config => "${mock_path}/pupent-1.2-el5-i386-cve.cfg",
+ build_root => 'pupent-1.2-el5-i386-cve',
+ target_arch => 'i386',
+ dist => 'el5',
+ dist_macro => '.el5',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent5latestserver-i386/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.2/repos/el-5-i386/',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-1.2-el5-x86_64-cve.cfg':
+ config => "${mock_path}/pupent-1.2-el5-x86_64-cve.cfg",
+ build_root => 'pupent-1.2-el5-x86_64-cve',
+ target_arch => 'x86_64',
+ dist => 'el5',
+ dist_macro => '.el5',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent5latestserver-x86_64/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.2/repos/el-5-x86_64',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-1.2-el6-i386-cve.cfg':
+ config => "${mock_path}/pupent-1.2-el6-i386-cve.cfg",
+ build_root => 'pupent-1.2-el6-i386-cve',
+ target_arch => 'i386',
+ dist => 'el6',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent6latestserver-i386/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.2/repos/el-6-i386',
+ failover_priority => 'base',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-1.2-el6-x86_64-cve.cfg':
+ config => "${mock_path}/pupent-1.2-el6-x86_64-cve.cfg",
+ build_root => 'pupent-1.2-el6-x86_64-cve',
+ target_arch => 'x86_64',
+ dist => 'el6',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent6latestserver-x86_64/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.2/repos/el-6-x86_64',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-2.0-el4-i386-cve.cfg':
+ config => "${mock_path}/pupent-2.0-el4-i386-cve.cfg",
+ build_root => 'pupent-2.0-el4-i386-cve',
+ target_arch => 'i386',
+ dist => 'el4',
+ dist_macro => '.el4',
+ base_repo_baseurl => 'http://vault.centos.org/4.9/os/i386',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.0/repos/el-4-i386',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-2.0-el4-x86_64-cve.cfg':
+ config => "${mock_path}/pupent-2.0-el4-x86_64-cve.cfg",
+ build_root => 'pupent-2.0-el4-x86_64-cve',
+ target_arch => 'x86_64',
+ dist => 'el4',
+ dist_macro => '.el4',
+ base_repo_baseurl => 'http://vault.centos.org/4.9/os/x86_64/',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.0/repos/el-4-x86_64',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-2.0-el5-i386-cve.cfg':
+ config => "${mock_path}/pupent-2.0-el5-i386-cve.cfg",
+ build_root => 'pupent-2.0-el5-i386-cve',
+ target_arch => 'i386',
+ dist => 'el5',
+ dist_macro => '.el5',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent5latestserver-i386/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.0/repos/el-5-i386/',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-2.0-el5-x86_64-cve.cfg':
+ config => "${mock_path}/pupent-2.0-el5-x86_64-cve.cfg",
+ build_root => 'pupent-2.0-el5-x86_64-cve',
+ target_arch => 'x86_64',
+ dist => 'el5',
+ dist_macro => '.el5',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent5latestserver-x86_64/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.0/repos/el-5-x86_64',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-2.0-el6-i386-cve.cfg':
+ config => "${mock_path}/pupent-2.0-el6-i386-cve.cfg",
+ build_root => 'pupent-2.0-el6-i386-cve',
+ target_arch => 'i386',
+ dist => 'el6',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent6latestserver-i386/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.0/repos/el-6-i386',
+ failover_priority => 'base',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-2.0-el6-x86_64-cve.cfg':
+ config => "${mock_path}/pupent-2.0-el6-x86_64-cve.cfg",
+ build_root => 'pupent-2.0-el6-x86_64-cve',
+ target_arch => 'x86_64',
+ dist => 'el6',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent6latestserver-x86_64/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.0/repos/el-6-x86_64',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-el4-i386.cfg':
+ config => "${mock_path}/pupent-el4-i386.cfg",
+ build_root => 'pupent-el4-i386',
+ target_arch => 'i386',
+ dist => 'el4',
+ base_repo_baseurl => 'http://vault.centos.org/4.9/os/i386',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.0/repos/el-4-i386',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-el4-x86_64.cfg':
+ config => "${mock_path}/pupent-el4-x86_64.cfg",
+ build_root => 'pupent-el4-x86_64',
+ target_arch => 'x86_64',
+ dist => 'el4',
+ base_repo_baseurl => 'http://vault.centos.org/4.9/os/x86_64/',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.0/repos/el-4-x86_64',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-el5-i386.cfg':
+ config => "${mock_path}/pupent-el5-i386.cfg",
+ build_root => 'pupent-el5-i386',
+ target_arch => 'i386',
+ dist => 'el5',
+ dist_macro => '.el5',
+ base_repo_baseurl => 'http://mirrors.cat.pdx.edu/centos/5/os/i386/',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/el-5-i386/',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-el5-x86_64.cfg':
+ config => "${mock_path}/pupent-el5-x86_64.cfg",
+ build_root => 'pupent-el5-x86_64',
+ target_arch => 'x86_64',
+ dist => 'el5',
+ dist_macro => '.el5',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent5latestserver-x86_64/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/el-5-x86_64',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-el6-i386.cfg':
+ config => "${mock_path}/pupent-el6-i386.cfg",
+ build_root => 'pupent-el6-i386',
+ target_arch => 'i386',
+ dist => 'el6',
+ base_repo_baseurl => 'http://mirrors.cat.pdx.edu/centos/6/os/i386/',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/el-6-i386',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-el6-x86_64.cfg':
+ config => "${mock_path}/pupent-el6-x86_64.cfg",
+ build_root => 'pupent-el6-x86_64',
+ target_arch => 'x86_64',
+ dist => 'el6',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent6latestserver-x86_64/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/el-6-x86_64',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-extras-el5-i386.cfg':
+ config => "${mock_path}/pupent-extras-el5-i386.cfg",
+ build_root => 'pupent-extras-el5-i386',
+ target_arch => 'i386',
+ dist => 'el5',
+ dist_macro => '.el5',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent5latestserver-i386/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/el-5-i386/',
+ extras_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/yum-enterprise/el/5/extras/i386',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-extras-el5-x86_64.cfg':
+ config => "${mock_path}/pupent-extras-el5-x86_64.cfg",
+ build_root => 'pupent-extras-el5-x86_64',
+ target_arch => 'x86_64',
+ dist => 'el5',
+ dist_macro => '.el5',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent5latestserver-x86_64/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/el-5-x86_64',
+ extras_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/yum-enterprise/el/5/extras/x86_64',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-extras-el6-i386.cfg':
+ config => "${mock_path}/pupent-extras-el6-i386.cfg",
+ build_root => 'pupent-extras-el6-i386',
+ target_arch => 'i386',
+ dist => 'el6',
+ base_mirrorlist => 'http://mirrorlist.centos.org/?release=6&arch=i386&repo=os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/el-6-i386',
+ extras_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/yum-enterprise/el/6/extras/i386',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-extras-el6-x86_64.cfg':
+ config => "${mock_path}/pupent-extras-el6-x86_64.cfg",
+ build_root => 'pupent-extras-el6-x86_64',
+ target_arch => 'x86_64',
+ dist => 'el6',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent6latestserver-x86_64/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/el-6-x86_64',
+ extras_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/yum-enterprise/el/6/extras/x86_64',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-fc15-i386.cfg':
+ config => "${mock_path}/pupent-fc15-i386.cfg",
+ build_root => 'pupent-fc15-i386',
+ target_arch => 'i386',
+ legal_host_arches => 'i386',
+ dist => 'fc15',
+ base_repo_baseurl => 'http://localhost/os/fc/15/i386',
+ pe_repo_baseurl => 'file:///tmp/output/pe/fc/15/i386',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-fc15-x86_64.cfg':
+ config => "${mock_path}/pupent-fc15-x86_64.cfg",
+ build_root => 'pupent-fc15-x86_64',
+ target_arch => 'x86_64',
+ legal_host_arches => 'x86_64',
+ dist => 'fc15',
+ base_repo_baseurl => 'http://localhost/os/fc/15/x86_64',
+ pe_repo_baseurl => 'file:///tmp/output/pe/fc/15/x86_64',
+ }
+}
View
33 manifests/mock/pl_config.pp
@@ -0,0 +1,33 @@
+define rpmbuilder::mock::pl_config (
+ $config,
+ $build_root,
+ $target_arch,
+ $legal_host_arches = "'i386','i586','i686','x86_64'",
+ $chroot_setup_cmd = "groupinstall buildsys-build",
+ $dist,
+ $dist_macro = undef,
+ $base_repo_baseurl = undef,
+ $base_mirrorlist = undef,
+ $base_debug_mirrorlist = undef,
+ $updates_repo_baseurl = undef,
+ $updates_mirrorlist = undef,
+ $updates_debug_mirrorlist = undef,
+ $updates_repo_enabled = '1',
+ $debug_mirrorlist = undef,
+ $puppet_prod_baseurl = undef,
+ $puppet_deps_baseurl = undef,
+ $puppet_dev_baseurl = undef,
+ $epel_repo_mirrorlist = undef,
+ $failover_priority = undef,
+ $is_vendor_puppetlabs = undef,
+) {
+
+ file { "${config}":
+ ensure => present,
+ mode => '0644',
+ owner => 'root',
+ group => 'root',
+ content => template("rpmbuilder/pl-mock-config.erb"),
+ require => Package['mock'],
+ }
+}
View
263 manifests/mock/puppetlabs_mocks.pp
@@ -0,0 +1,263 @@
+class mock::puppetlabs_mocks {
+
+ $mock_path = '/etc/mock'
+
+ Package['mock'] -> Rpmbuilder::Mock::Pl_config<| |>
+
+ rpmbuilder::mock::pl_config { 'pl-5-i386.cfg':
+ config => "${mock_path}/pl-5-i386.cfg",
+ build_root => 'pl-5-i386',
+ target_arch => 'i386',
+ dist => 'el5',
+ dist_macro => '.el5',
+ base_mirrorlist => 'http://mirrorlist.centos.org/?release=5&arch=i386&repo=os',
+ updates_mirrorlist => 'http://mirrorlist.centos.org/?release=5&arch=i386&repo=updates',
+ puppet_prod_baseurl => 'http://yum.puppetlabs.com/el/5/products/i386',
+ puppet_deps_baseurl => 'http://yum.puppetlabs.com/el/5/dependencies/i386',
+ epel_repo_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=i386',
+ failover_priority => 'base',
+ }
+
+ rpmbuilder::mock::pl_config { 'pl-5-i386-dev.cfg':
+ config => "${mock_path}/pl-5-i386-dev.cfg",
+ build_root => 'pl-5-i386-dev',
+ target_arch => 'i386',
+ dist => 'el5',
+ dist_macro => '.el5',
+ base_mirrorlist => 'http://mirrorlist.centos.org/?release=5&arch=i386&repo=os',
+ updates_mirrorlist => 'http://mirrorlist.centos.org/?release=5&arch=i386&repo=updates',
+ puppet_prod_baseurl => 'http://yum.puppetlabs.com/el/5/products/i386',
+ puppet_deps_baseurl => 'http://yum.puppetlabs.com/el/5/dependencies/i386',
+ epel_repo_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=i386',
+ failover_priority => 'base',
+ }
+
+ rpmbuilder::mock::pl_config { 'pl-5-x86_64.cfg':
+ config => "${mock_path}/pl-5-x86_64.cfg",
+ build_root => 'pl-5-x86_64',
+ target_arch => 'x86_64',
+ dist => 'el5',
+ dist_macro => '.el5',
+ base_mirrorlist => 'http://mirrorlist.centos.org/?release=5&arch=x86_64&repo=os',
+ updates_mirrorlist => 'http://mirrorlist.centos.org/?release=5&arch=x86_64&repo=updates',
+ puppet_prod_baseurl => 'http://yum.puppetlabs.com/el/5/products/x86_64',
+ puppet_deps_baseurl => 'http://yum.puppetlabs.com/el/5/dependencies/x86_64',
+ epel_repo_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=x86_64',
+ failover_priority => 'base',
+ }
+
+ rpmbuilder::mock::pl_config { 'pl-5-x86_64-dev.cfg':
+ config => "${mock_path}/pl-5-x86_64-dev.cfg",
+ build_root => 'pl-5-x86_64-dev',
+ target_arch => 'x86_64',
+ dist => 'el5',
+ dist_macro => '.el5',
+ base_mirrorlist => 'http://mirrorlist.centos.org/?release=5&arch=x86_64&repo=os',
+ updates_mirrorlist => 'http://mirrorlist.centos.org/?release=5&arch=x86_64&repo=updates',
+ puppet_prod_baseurl => 'http://yum.puppetlabs.com/el/5/products/x86_64/',
+ puppet_deps_baseurl => 'http://yum.puppetlabs.com/el/5/dependencies/x86_64/',
+ puppet_dev_baseurl => 'http://yum.puppetlabs.com/el/5/devel/x86_64/',
+ epel_repo_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=x86_64',
+ failover_priority => 'base',
+ }
+
+ rpmbuilder::mock::pl_config { 'pl-6-i386.cfg':
+ config => "${mock_path}/pl-6-i386.cfg",
+ build_root => 'pl-6-i386',
+ target_arch => 'i386',
+ dist => 'el6',
+ base_mirrorlist => 'http://mirrorlist.centos.org/?release=6&arch=i386&repo=os',
+ updates_mirrorlist => 'http://mirrorlist.centos.org/?release=6&arch=i386&repo=updates',
+ puppet_prod_baseurl => 'http://yum.puppetlabs.com/el/6/products/i386',
+ puppet_deps_baseurl => 'http://yum.puppetlabs.com/el/6/dependencies/i386',
+ epel_repo_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=i386',
+ failover_priority => 'base',
+ }
+
+ rpmbuilder::mock::pl_config { 'pl-6-i386-dev.cfg':
+ config => "${mock_path}/pl-6-i386-dev.cfg",
+ build_root => 'pl-6-i386-dev',
+ target_arch => 'i386',
+ dist => 'el6',
+ base_mirrorlist => 'http://mirrorlist.centos.org/?release=6&arch=i386&repo=os',
+ updates_mirrorlist => 'http://mirrorlist.centos.org/?release=6&arch=i386&repo=updates',
+ puppet_prod_baseurl => 'http://yum.puppetlabs.com/el/6/products/i386',
+ puppet_deps_baseurl => 'http://yum.puppetlabs.com/el/6/dependencies/i386',
+ epel_repo_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=i386',
+ failover_priority => 'base',
+ }
+
+ rpmbuilder::mock::pl_config { 'pl-6-x86_64.cfg':
+ config => "${mock_path}/pl-6-x86_64.cfg",
+ build_root => 'pl-6-x86_64',
+ target_arch => 'x86_64',
+ dist => 'el6',
+ base_mirrorlist => 'http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os',
+ updates_mirrorlist => 'http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=updates',
+ puppet_prod_baseurl => 'http://yum.puppetlabs.com/el/6/products/x86_64',
+ puppet_deps_baseurl => 'http://yum.puppetlabs.com/el/6/dependencies/x86_64',
+ epel_repo_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=x86_64',
+ failover_priority => 'base',
+ }
+
+ rpmbuilder::mock::pl_config { 'pl-6-x86_64-dev.cfg':
+ config => "${mock_path}/pl-6-x86_64-dev.cfg",
+ build_root => 'pl-6-x86_64-dev',
+ target_arch => 'x86_64',
+ dist => 'el6',
+ base_mirrorlist => 'http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os',
+ updates_mirrorlist => 'http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=updates',
+ puppet_prod_baseurl => 'http://yum.puppetlabs.com/el/6/products/x86_64/',
+ puppet_deps_baseurl => 'http://yum.puppetlabs.com/el/6/dependencies/x86_64/',
+ puppet_dev_baseurl => 'http://yum.puppetlabs.com/el/6/devel/x86_64/',
+ epel_repo_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=x86_64',
+ failover_priority => 'base',
+ }
+
+ rpmbuilder::mock::pl_config { 'pl-fc15-i386.cfg':
+ config => "${mock_path}/pl-fc15-i386.cfg",
+ build_root => 'pl-fc15-i386',
+ target_arch => 'i686',
+ dist => 'fc15',
+ base_mirrorlist => 'http://mirrors.cat.pdx.edu/fedora/linux/releases/15/Fedora/i386/os/',
+ updates_mirrorlist => 'http://mirrors.cat.pdx.edu/fedora/linux/updates/15/i386',
+ puppet_prod_baseurl => 'http://yum.puppetlabs.com/fedora/f15/products/i386/',
+ puppet_deps_baseurl => 'http://yum.puppetlabs.com/fedora/f15/dependencies/i386/',
+ }
+
+ rpmbuilder::mock::pl_config { 'pl-fc15-i386-dev.cfg':
+ config => "${mock_path}/pl-fc15-i386-dev.cfg",
+ build_root => 'pl-fc15-i386-dev',
+ target_arch => 'i686',
+ dist => 'fc15',
+ base_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-15&arch=i386',
+ updates_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f15&arch=i386',
+ puppet_prod_baseurl => 'http://yum.puppetlabs.com/fedora/f15/products/i386/',
+ puppet_deps_baseurl => 'http://yum.puppetlabs.com/fedora/f15/dependencies/i386/',
+ puppet_dev_baseurl => 'http://yum.puppetlabs.com/fedora/f15/devel/i386/',
+ }
+
+ rpmbuilder::mock::pl_config { 'pl-fc15-x86_64.cfg':
+ config => "${mock_path}/pl-fc15-x86_64.cfg",
+ build_root => 'pl-fc15-x86_64',
+ target_arch => 'x86_64',
+ dist => 'fc15',
+ base_repo_baseurl => 'http://mirrors.cat.pdx.edu/fedora/linux/releases/15/Fedora/x86_64/os/',
+ updates_repo_baseurl => 'http://mirrors.cat.pdx.edu/fedora/linux/updates/15/x86_64',
+ puppet_prod_baseurl => 'http://yum.puppetlabs.com/fedora/f15/products/x86_64/',
+ puppet_deps_baseurl => 'http://yum.puppetlabs.com/fedora/f15/dependencies/x86_64/',
+ }
+
+ rpmbuilder::mock::pl_config { 'pl-fc15-x86_64-dev.cfg':
+ config => "${mock_path}/pl-fc15-x86_64-dev.cfg",
+ build_root => 'pl-fc15-x86_64-dev',
+ target_arch => 'x86_64',
+ dist => 'fc15',
+ base_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-15&arch=x86_64',
+ updates_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f15&arch=x86_64',
+ puppet_prod_baseurl => 'http://yum.puppetlabs.com/fedora/f15/products/x86_64/',
+ puppet_deps_baseurl => 'http://yum.puppetlabs.com/fedora/f15/dependencies/x86_64/',
+ puppet_dev_baseurl => 'http://yum.puppetlabs.com/fedora/f15/devel/x86_64/',
+ }
+
+ rpmbuilder::mock::pl_config { 'pl-fc16-i386.cfg':
+ config => "${mock_path}/pl-fc16-i386.cfg",
+ build_root => 'fedora-16-i386',
+ target_arch => 'i386',
+ dist => 'fc16',
+ base_repo_baseurl => 'http://mirrors.cat.pdx.edu/fedora/linux/releases/16/Fedora/i386/os/',
+ updates_repo_baseurl => 'http://mirrors.cat.pdx.edu/fedora/linux/updates/16/i386',
+ puppet_prod_baseurl => 'http://yum.puppetlabs.com/fedora/f16/products/i386/',
+ puppet_deps_baseurl => 'http://yum.puppetlabs.com/fedora/f16/dependencies/i386/',
+ }
+
+ rpmbuilder::mock::pl_config { 'pl-fc16-i386-dev.cfg':
+ config => "${mock_path}/pl-fc16-i386-dev.cfg",
+ build_root => 'pl-fc16-i386-dev',
+ target_arch => 'x86_64',
+ dist => 'i686',
+ base_repo_baseurl => 'http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-16&arch=i386',
+ updates_repo_baseurl => 'http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f16&arch=i386',
+ puppet_prod_baseurl => 'http://yum.puppetlabs.com/fedora/f16/products/i386/',
+ puppet_deps_baseurl => 'http://yum.puppetlabs.com/fedora/f16/dependencies/i386/',
+ puppet_dev_baseurl => 'http://yum.puppetlabs.com/fedora/f16/devel/i386/',
+ }
+
+ rpmbuilder::mock::pl_config { 'pl-fc16-x86_64.cfg':
+ config => "${mock_path}/pl-fc16-x86_64.cfg",
+ build_root => 'pl-fc16-x86_64',
+ target_arch => 'x86_64',
+ dist => 'fc16',
+ base_mirrorlist => 'http://mirrors.cat.pdx.edu/fedora/linux/releases/16/Fedora/x86_64/os/',
+ updates_mirrorlist => 'http://mirrors.cat.pdx.edu/fedora/linux/updates/16/x86_64',
+ puppet_prod_baseurl => 'http://yum.puppetlabs.com/fedora/f16/products/x86_64/',
+ puppet_deps_baseurl => 'http://yum.puppetlabs.com/fedora/f16/dependencies/x86_64/',
+ }
+
+ rpmbuilder::mock::pl_config { 'pl-fc16-x86_64-dev.cfg':
+ config => "${mock_path}/pl-fc16-x86_64-dev.cfg",
+ build_root => 'fedora-17-x86_64',
+ target_arch => 'x86_64',
+ dist => 'fc16',
+ base_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-16&arch=x86_64',
+ updates_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f16&arch=x86_64',
+ puppet_prod_baseurl => 'http://yum.puppetlabs.com/fedora/f16/products/x86_64/',
+ puppet_deps_baseurl => 'http://yum.puppetlabs.com/fedora/f16/dependencies/x86_64/',
+ puppet_dev_baseurl => 'http://yum.puppetlabs.com/fedora/f16/devel/x86_64/',
+ }
+
+ rpmbuilder::mock::pl_config { 'pl-fc17-i386.cfg':
+ config => "${mock_path}/pl-fc17-i386.cfg",
+ build_root => 'pl-fc17-i386',
+ target_arch => 'i686',
+ dist => 'fc17',
+ base_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-17&arch=i386',
+ base_debug_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-debug-17&arch=i386',
+ updates_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f17&arch=i386',
+ updates_debug_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-debug-f17&arch=i386',
+ puppet_prod_baseurl => 'http://yum.puppetlabs.com/fedora/f17/products/i386/',
+ puppet_deps_baseurl => 'http://yum.puppetlabs.com/fedora/f17/dependencies/',
+ }
+
+ rpmbuilder::mock::pl_config { 'pl-fc17-i386-dev.cfg':
+ config => "${mock_path}/pl-fc17-i386-dev.cfg",
+ build_root => 'pl-fc17-i386-dev',
+ target_arch => 'i686',
+ dist => 'fc17',
+ base_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-17&arch=i386',
+ base_debug_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-debug-17&arch=i386',
+ updates_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f17&arch=i386',
+ updates_debug_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-debug-f17&arch=i386',
+ puppet_prod_baseurl => 'http://yum.puppetlabs.com/fedora/f17/products/i386/',
+ puppet_deps_baseurl => 'http://yum.puppetlabs.com/fedora/f17/dependencies/i386/',
+ puppet_dev_baseurl => 'http://yum.puppetlabs.com/fedora/f17/devel/i386/',
+ }
+
+ rpmbuilder::mock::pl_config { 'pl-fc17-x86_64.cfg':
+ config => "${mock_path}/pl-fc17-x86_64.cfg",
+ build_root => 'pl-fc-17-x86_64',
+ target_arch => 'x86_64',
+ dist => 'fc17',
+ base_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-17&arch=x86_64',
+ base_debug_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-debug-17&arch=x86_64',
+ updates_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f17&arch=x86_64',
+ updates_debug_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-debug-f17&arch=x86_64',
+ puppet_prod_baseurl => 'http://yum.puppetlabs.com/fedora/f17/products/x86_64/',
+ puppet_deps_baseurl => 'http://yum.puppetlabs.com/fedora/f17/dependencies/x86_64/',
+ }
+
+ rpmbuilder::mock::pl_config { 'pl-fc17-x86_64-dev.cfg':
+ config => "${mock_path}/pl-fc17-x86_64-dev.cfg",
+ build_root => 'pl-fc17-x86_64-dev',
+ target_arch => 'x86_64',
+ dist => 'fc17',
+ base_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-17&arch=x86_64',
+ base_debug_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-debug-17&arch=i386',
+ updates_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f17&arch=x86_64',
+ updates_debug_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-debug-f17&arch=i386',
+ puppet_prod_baseurl => 'http://yum.puppetlabs.com/fedora/f17/products/x86_64/',
+ puppet_deps_baseurl => 'http://yum.puppetlabs.com/fedora/f17/dependencies/x86_64/',
+ puppet_dev_baseurl => 'http://yum.puppetlabs.com/fedora/f17/devel/x86_64/',
+ }
+}
+
View
48 spec/classes/pe_mocks_spec.rb
@@ -0,0 +1,48 @@
+require 'spec_helper'
+
+describe 'rpmbuilder::mock::pe_config', :type => 'class' do
+
+ context 'Each Puppet Labs Enterprise mock configuration file should be present' do
+
+ let(:pre_condition) do
+ 'package { "mock": ensure => present }'
+ end
+
+ configs = [
+ 'pupent-1.1-el4-i386-cve.cfg',
+ 'pupent-1.1-el4-x86_64-cve.cfg',
+ 'pupent-1.1-el5-i386-cve.cfg',
+ 'pupent-1.1-el5-x86_64-cve.cfg',
+ 'pupent-1.1-el6-i386-cve.cfg',
+ 'pupent-1.1-el6-x86_64-cve.cfg',
+ 'pupent-1.2-el4-i386-cve.cfg',
+ 'pupent-1.2-el4-x86_64-cve.cfg',
+ 'pupent-1.2-el5-i386-cve.cfg',
+ 'pupent-1.2-el5-x86_64-cve.cfg',
+ 'pupent-1.2-el6-i386-cve.cfg',
+ 'pupent-1.2-el6-x86_64-cve.cfg',
+ 'pupent-2.0-el4-i386-cve.cfg',
+ 'pupent-2.0-el4-x86_64-cve.cfg',
+ 'pupent-2.0-el5-i386-cve.cfg',
+ 'pupent-2.0-el5-x86_64-cve.cfg',
+ 'pupent-2.0-el6-i386-cve.cfg',
+ 'pupent-2.0-el6-x86_64-cve.cfg',
+ 'pupent-el4-i386.cfg',
+ 'pupent-el4-x86_64.cfg',
+ 'pupent-el5-i386.cfg',
+ 'pupent-el5-x86_64.cfg',
+ 'pupent-el6-i386.cfg',
+ 'pupent-el6-x86_64.cfg',
+ 'pupent-extras-el5-i386.cfg',
+ 'pupent-extras-el5-x86_64.cfg',
+ 'pupent-extras-el6-i386.cfg',
+ 'pupent-extras-el6-x86_64.cfg',
+ 'pupent-fc15-i386.cfg',
+ 'pupent-fc15-x86_64.cfg'
+ ]
+
+ configs.each do|config|
+ it { should contain_Pe_mock__Config("#{config}") }
+ end
+ end
+end
View
37 spec/classes/puppetlabs_mocks_spec.rb
@@ -0,0 +1,37 @@
+require 'spec_helper'
+
+describe 'rpmbuilder::mock::puppetlabs_mocks', :type => 'class' do
+
+ context 'Each Puppet Labs mock configuration file should be present' do
+
+ let(:pre_condition) do
+ 'package { "mock": ensure => present }'
+ end
+
+ configs = [
+ 'pl-5-i386.cfg',
+ 'pl-5-i386-dev.cfg',
+ 'pl-5-x86_64.cfg',
+ 'pl-5-x86_64-dev.cfg',
+ 'pl-6-i386.cfg',
+ 'pl-6-i386-dev.cfg',
+ 'pl-6-x86_64.cfg',
+ 'pl-6-x86_64-dev.cfg',
+ 'pl-fc15-i386.cfg',
+ 'pl-fc15-x86_64.cfg',
+ 'pl-fc15-x86_64-dev.cfg',
+ 'pl-fc16-i386.cfg',
+ 'pl-fc16-i386-dev.cfg',
+ 'pl-fc16-x86_64.cfg',
+ 'pl-fc17-i386.cfg',
+ 'pl-fc17-i386-dev.cfg',
+ 'pl-fc17-x86_64.cfg',
+ 'pl-fc17-x86_64-dev.cfg'
+ ]
+
+ configs.each do|config|
+ it { should contain_Mock__Pl_config("#{config}") }
+ end
+ end
+end
+
View
5 spec/classes/rpmbuilder_spec.rb
@@ -12,9 +12,8 @@
context "Extra components that may be included" do
let(:pre_condition) { 'class rpmbuilder::packages::extra {}' }
- let(:pre_condition) { 'class mock {}' }
+ let(:pre_condition) { 'class mock::puppetlabs_mocks {}' }
it { should include_class("rpmbuilder::packages::extra") }
- it { should include_class("mock") }
-
+ it { should include_class("mock::puppetlabs_mocks") }
end
end
View
25 spec/defines/config_spec.rb
@@ -0,0 +1,25 @@
+require 'spec_helper'
+
+describe 'rpmbuilder::mock::pe_config', :type => 'define' do
+
+ let(:title) { 'pe_mock' }
+ context 'Given some parameters, a configuration should be created' do
+
+ let(:params) {{
+ :config => '/etc/mock/pupent-2.0-el6-i386-cve.cfg',
+ :build_root => 'pupent-2.0-el6-i386-cve',
+ :target_arch => 'i386',
+ :dist => 'el6',
+ :base_repo_baseurl => 'http://yo.puppetlabs.lan/cent6latestserver-i386/RPMS.os',
+ :pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.0/repos/el-6-i386',
+ :failover_priority => 'base'
+ }}
+
+ it 'should generate valid content for the mock configuration file' do
+ content = catalogue.resource('file', "#{params[:config]}").send(:parameters)[:content]
+ content.should_not be_empty
+ end
+
+ it { should contain_file("#{params[:config]}").with_ensure('present') }
+ end
+end
View
32 spec/defines/pl_config_spec.rb
@@ -0,0 +1,32 @@
+require 'spec_helper'
+
+describe 'rpmbuilder::mock::pl_config', :type => 'define' do
+
+ let(:title) { 'pl-mock' }
+ context 'Given some parameters, a configuration should be created' do
+
+ let(:params) {{
+ :config => '/etc/mock/pl-5-i386.cfg',
+ :build_root => 'pl-5-i386',
+ :target_arch => 'i386',
+ :dist => 'el5',
+ :dist_macro => '.el5',
+ :base_mirrorlist => 'http://mirrorlist.centos.org/?release=5&arch=i386&repo=os',
+ :updates_mirrorlist => 'http://mirrorlist.centos.org/?release=5&arch=i386&repo=updates',
+ :puppet_prod_baseurl => 'http://yum.puppetlabs.com/el/5/products/i386',
+ :puppet_deps_baseurl => 'http://yum.puppetlabs.com/el/5/dependencies/i386',
+ :epel_repo_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=i386',
+ :failover_priority => 'base',
+ }}
+
+ it 'should generate valid content for the mock configuration file' do
+ content = catalogue.resource('file', "#{params[:config]}").send(:parameters)[:content]
+ content.should_not be_empty
+ end
+
+ it do should contain_file("#{params[:config]}").with({
+ 'ensure' => 'present',
+ 'require' => 'Package[mock]'
+ }) end
+ end
+end
View
104 templates/pl-mock-config.erb
@@ -0,0 +1,104 @@
+# **********************************
+# Puppet Labs mock configuration
+<%= "# #{config}" %>
+# Managed by Puppet
+# **********************************
+
+config_opts['root'] = '<%= build_root %>'
+config_opts['target_arch'] = '<%= target_arch %>'
+config_opts['legal_host_arches'] = (<%= legal_host_arches %>)
+config_opts['chroot_setup_cmd'] = '<%= chroot_setup_cmd %>'
+config_opts['dist']= '<%= dist %>'
+<% if @dist_macro -%>
+config_opts['macros']['%dist'] = '<%= dist_macro %>'
+<% end -%>
+<% if @is_vendor_puppetlabs -%>
+config_opts['macros']['%_host_vendor'] = 'Puppet Labs'
+<%end -%>
+
+config_opts['yum.conf'] = """
+
+[main]
+cachedir=/var/cache/yum
+debuglevel=1
+reposdir=/dev/null
+logfile=/var/log/yum.log
+retries=20
+obsoletes=1
+gpgcheck=0
+assumeyes=1
+syslog_ident=mock
+syslog_device=
+<% if @base_repo_baseurl or @base_mirrorlist -%>
+
+[base]
+name=BaseOS
+<% if @base_repo_baseurl -%>
+baseurl=<%= base_repo_baseurl %>
+<% end -%>
+<% if @base_mirrorlist -%>
+mirrorlist=<%= base_mirrorlist %>
+<% end -%>
+enabled=1
+<% if @failover_priority == "base" -%>
+failovermethod=priority
+<% end -%>
+<% end -%>
+<% if @updates_repo_baseurl or @updates_mirrorlist -%>
+
+[updates]
+name=<%= dist %>-<%= target_arch %>-updates
+<% if @updates_repo_baseurl -%>
+baseurl=<%= updates_repo_baseurl %>
+<% end -%>
+<% if @updates_mirrorlist -%>
+mirrorlist=<%= updates_mirrorlist %>
+<% end -%>
+enabled=<%= updates_repo_enabled %>
+<% if @failover_priority == "updates" -%>
+failovermethod=priority
+<% end -%>
+<% end -%>
+<% if @base_debug_mirrorlist -%>
+
+[base-debug]
+name=<% dist %>-debug-base
+mirrorlist=<%= base_debug_mirrorlist %>
+enabled=1
+<% end -%>
+<% if @updates_debug_mirrorlist -%>
+
+[updates-debug]
+name=<% dist %>-debug-updates
+mirrorlist=<%= updates_debug_mirrorlist %>
+enabled=1
+<% end -%>
+<% if @puppet_prod_baseurl -%>
+
+[puppet]
+name=yum.puppetlabs-prod
+baseurl=<%= puppet_prod_baseurl %>
+enabled=1
+<% end -%>
+<% if @puppet_deps_baseurl -%>
+
+[puppet-deps]
+name=yum.puppetlabs-deps
+baseurl=<%= puppet_deps_baseurl %>
+enabled=1
+<% end -%>
+<% if @puppet_dev_baseurl -%>
+
+[puppet-dev]
+name=yum.puppetlabs-dev
+baseurl=<%= puppet_dev_baseurl %>
+enabled=1
+<% end -%>
+<% if @epel_repo_mirrorlist -%>
+
+[epel]
+name=epel
+mirrorlist=<%= epel_repo_mirrorlist %>
+includepkgs=epel-release ccache
+<% end -%>
+"""
View
75 templates/pupent-mock-config.erb
@@ -0,0 +1,75 @@
+# ************************************
+# Puppet Enterprise mock configuration
+<%= "# #{config}" %>
+# Managed by Puppet
+# ************************************
+
+config_opts['root'] = '<%= build_root %>'
+config_opts['target_arch'] = '<%= target_arch %>'
+config_opts['legal_host_arches'] = (<%= legal_host_arches %>)
+config_opts['chroot_setup_cmd'] = '<%= chroot_setup_cmd %>'
+config_opts['dist']= '<%= dist %>'
+config_opts['plugin_conf']['ccache_enable'] = <%= ccache_enable %>
+<% if @dist_macro -%>
+config_opts['macros']['%dist'] = '<%= dist_macro %>'
+<% end -%>
+config_opts['yum.conf'] = """
+
+[main]
+cachedir=/var/cache/yum
+debuglevel=1
+reposdir=/dev/null
+logfile=/var/log/yum.log
+retries=20
+obsoletes=1
+gpgcheck=0
+assumeyes=1
+syslog_ident=mock
+syslog_device=
+proxy=http://modi.puppetlabs.lan:3128/
+<% if @base_repo_baseurl or @base_mirrorlist -%>
+
+[base]
+name=BaseOS
+enabled=1
+<% if @base_repo_baseurl -%>
+baseurl=<%= base_repo_baseurl %>
+<% end -%>
+<% if @base_mirrorlist -%>
+mirrorlist=<%= base_mirrorlist %>
+<% end -%>
+<% if @failover_priority == "base" -%>
+failovermethod=priority
+<% end -%>
+<% end -%>
+<% if @updates_repo_baseurl or @updates_mirrorlist -%>
+
+[updates]
+name=<%= dist %>-<%= target_arch %>-updates
+enabled=<%= updates_repo_enabled %>
+<% if @updates_repo_baseurl -%>
+baseurl=<%= updates_repo_baseurl %>
+<% end -%>
+<% if @updates_mirrorlist -%>
+mirrorlist=<%= updates_mirrorlist %>
+<% end -%>
+<% if @failover_priority == "updates" -%>
+failovermethod=priority
+<% end -%>
+<% end -%>
+
+[pe]
+name=pe
+enabled=1
+baseurl=<%= pe_repo_baseurl %>
+skip_if_unavailable=1
+proxy=_none_
+<% if @extras_repo_baseurl -%>
+[pe_extras]
+name=pe_extras
+enabled=1
+baseurl=<%= extras_repo_baseurl %>
+skip_if_unavailable=1
+proxy=_none_
+<% end -%>
+"""
Please sign in to comment.
Something went wrong with that request. Please try again.