Skip to content

Commit

Permalink
Parameterize all the yumrepos classes
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffsheltren committed Mar 4, 2014
1 parent 2e1233e commit 07aa8ba
Show file tree
Hide file tree
Showing 7 changed files with 150 additions and 42 deletions.
22 changes: 15 additions & 7 deletions manifests/ius.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
class yumrepos::ius {
class yumrepos::ius (
$ius_url = $yumrepos::params::ius_url,
$ius_enabled = $yumrepos::params::ius_enabled,
$ius_gpgcheck = $yumrepos::params::ius_gpgcheck,
$ius_includepkgs = $yumrepos::params::ius_includepkgs,
$ius_exclude = $yumrepos::params::ius_exclude,
) inherits yumrepos::params {
file { "/etc/pki/rpm-gpg/IUS-COMMUNITY-GPG-KEY":
ensure => present,
owner => root,
Expand All @@ -8,11 +14,13 @@
}

yumrepo { 'ius':
descr => 'IUS',
baseurl => "http://dl.iuscommunity.org/pub/ius/stable/Redhat/${::operatingsystemmajrelease}/${::architecture}",
enabled => '1',
gpgcheck => '1',
gpgkey => "file:///etc/pki/rpm-gpg/IUS-COMMUNITY-GPG-KEY",
require => [ Class['yumrepos::epel'], File['/etc/pki/rpm-gpg/IUS-COMMUNITY-GPG-KEY'] ],
descr => 'IUS',
baseurl => $ius_url,
enabled => $ius_enabled,
includepkgs => $ius_includepkgs,
exclude => $ius_exclude,
gpgcheck => $ius_gpgcheck,
gpgkey => "file:///etc/pki/rpm-gpg/IUS-COMMUNITY-GPG-KEY",
require => [ Class['yumrepos::epel'], File['/etc/pki/rpm-gpg/IUS-COMMUNITY-GPG-KEY'] ],
}
}
22 changes: 15 additions & 7 deletions manifests/jenkins.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
class yumrepos::jenkins {
class yumrepos::jenkins (
$jenkins_url = $yumrepos::params::jenkins_url,
$jenkins_enabled = $yumrepos::params::jenkins_enabled,
$jenkins_gpgcheck = $yumrepos::params::jenkins_gpgcheck,
$jenkins_includepkgs = $yumrepos::params::jenkins_includepkgs,
$jenkins_exclude = $yumrepos::params::jenkins_exclude,
) inherits yumrepos::params {

file { "/etc/pki/rpm-gpg/jenkins-ci.org.key":
ensure => present,
Expand All @@ -9,11 +15,13 @@
}

yumrepo { 'jenkins':
descr => 'Jenkins',
baseurl => 'http://pkg.jenkins-ci.org/redhat/',
enabled => '1',
gpgcheck => '1',
gpgkey => "file:///etc/pki/rpm-gpg/jenkins-ci.org.key",
require => File['/etc/pki/rpm-gpg/jenkins-ci.org.key'],
descr => 'Jenkins',
baseurl => $jenkins_url,
enabled => $jenkins_enabled,
includepkgs => $jenkins_includepkgs,
exclude => $jenkins_exclude,
gpgcheck => $jenkins_gpgcheck
gpgkey => "file:///etc/pki/rpm-gpg/jenkins-ci.org.key",
require => File['/etc/pki/rpm-gpg/jenkins-ci.org.key'],
}
}
21 changes: 15 additions & 6 deletions manifests/jpackage.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
class yumrepos::jpackage {
class yumrepos::jpackage (
$jpackage_mirrorlist = $yumrepos::params::jpackage_mirrorlist,
$jpackage_enabled = $yumrepos::params::jpackage_enabled,
$jpackage_gpgcheck = $yumrepos::params::jpackage_gpgcheck,
$jpackage_includepkgs = $yumrepos::params::jpackage_includepkgs,
$jpackage_exclude = $yumrepos::params::jpackage_exclude,
) inherits yumrepos::params {
$yum_jpackage_gpg = '/etc/pki/rpm-gpg/jpackage.asc'

file { $yum_jpackage_gpg:
Expand All @@ -10,10 +16,13 @@
}

yumrepo { 'jpackage':
descr => 'JPackage Generic',
mirrorlist => 'http://www.jpackage.org/mirrorlist.php?dist=generic&type=free&release=6.0',
gpgcheck => 1,
gpgkey => "file://${yum_jpackage_gpg}",
require => File[$yum_jpackage_gpg],
descr => 'JPackage 6.0 Generic',
mirrorlist => $jpackage_mirrorlist,
enabled => $jpackage_enabled,
includepkgs => $jpackage_includepkgs,
exclude => $jpackage_exclude,
gpgcheck => $jpackage_gpgcheck,
gpgkey => "file://${yum_jpackage_gpg}",
require => File[$yum_jpackage_gpg],
}
}
49 changes: 49 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,53 @@
$epel_includepkgs = absent
$epel_exclude = absent

# IUS Settings.
$ius_url = "http://dl.iuscommunity.org/pub/ius/stable/Redhat/${::operatingsystemmajrelease}/${::architecture}"
$ius_enabled = '1'
$ius_gpgcheck = '1'
$ius_includepkgs = absent
$ius_exclude = absent

# Jenkins Settings.
$jenkins_url = 'http://pkg.jenkins-ci.org/redhat/'
$jenkins_enabled = '1'
$jenkins_gpgcheck = '1'
$jenkins_includepkgs = absent
$jenkins_exclude = absent

# Jpackage Settings.
$jpackage_mirrorlist = 'http://www.jpackage.org/mirrorlist.php?dist=generic&type=free&release=6.0'
$jpackage_enabled = '1'
$jpackage_gpgcheck = '1'
$jpackage_includepkgs = absent
$jpackage_exclude = absent

# Percona Settings.
$percona_url = "http://repo.percona.com/centos/${::operatingsystemmajrelease}/os/${::architecture}"
$percona_enabled = '1'
$percona_gpgcheck = '1'
$percona_includepkgs = absent
# This default is to avoid dangerous behavior of replacing mysql core packages.
$percona_exclude = 'Percona-Server*'

# Puppetlabs Settings.
# Puppetlabs has two repos, "products" and "deps".
$puppetlabs_products_url = "http://yum.puppetlabs.com/el/${::operatingsystemmajrelease}/products/${::architecture}"
$puppetlabs_products_enabled = '1'
$puppetlabs_products_gpgcheck = '1'
$puppetlabs_products_includepkgs = absent
$puppetlabs_products_exclude = absent

$puppetlabs_deps_url = "http://yum.puppetlabs.com/el/${::operatingsystemmajrelease}/dependencies/${::architecture}"
$puppetlabs_deps_enabled = '1'
$puppetlabs_deps_gpgcheck = '1'
$puppetlabs_deps_includepkgs = absent
$puppetlabs_deps_exclude = absent

# Varnish 3 Settings.
$varnish3_url = "http://repo.varnish-cache.org/redhat/varnish-3.0/el${::operatingsystemmajrelease}/${::architecture}"
$varnish3_enabled = '1'
$varnish3_gpgcheck = '0'
$varnish3_includepkgs = absent
$varnish3_exclude = absent
}
23 changes: 16 additions & 7 deletions manifests/percona.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
class yumrepos::percona {
class yumrepos::percona (
$percona_url = $yumrepos::params::percona_url,
$percona_enabled = $yumrepos::params::percona_enabled,
$percona_gpgcheck = $yumrepos::params::percona_gpgcheck,
$percona_includepkgs = $yumrepos::params::percona_includepkgs,
$percona_exclude = $yumrepos::params::percona_exclude,
) inherits yumrepos::params {

file { "/etc/pki/rpm-gpg/RPM-GPG-KEY-percona":
ensure => present,
owner => root,
Expand All @@ -8,11 +15,13 @@
}

yumrepo { 'percona':
descr => 'Percona',
baseurl => "http://repo.percona.com/centos/${::operatingsystemmajrelease}/os/${::architecture}",
enabled => '1',
gpgcheck => '1',
gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-percona",
require => File['/etc/pki/rpm-gpg/RPM-GPG-KEY-percona'],
descr => 'Percona',
baseurl => $percona_url,
enabled => $percona_enabled,
includepkgs => $percona_includepkgs,
exclude => $percona_exclude,
gpgcheck => $percona_gpgcheck,
gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-percona",
require => File['/etc/pki/rpm-gpg/RPM-GPG-KEY-percona'],
}
}
36 changes: 26 additions & 10 deletions manifests/puppetlabs.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
class yumrepos::puppetlabs {
class yumrepos::puppetlabs (
$puppetlabs_products_url = $yumrepos::params::puppetlabs_products_url,
$puppetlabs_products_enabled = $yumrepos::params::puppetlabs_products_enabled,
$puppetlabs_products_gpgcheck = $yumrepos::params::puppetlabs_products_gpgcheck,
$puppetlabs_products_includepkgs = $yumrepos::params::puppetlabs_products_includepkgs,
$puppetlabs_products_exclude = $yumrepos::params::puppetlabs_products_exclude,
$puppetlabs_deps_url = $yumrepos::params::puppetlabs_deps_url,
$puppetlabs_deps_enabled = $yumrepos::params::puppetlabs_deps_enabled,
$puppetlabs_deps_gpgcheck = $yumrepos::params::puppetlabs_deps_gpgcheck,
$puppetlabs_deps_includepkgs = $yumrepos::params::puppetlabs_deps_includepkgs,
$puppetlabs_deps_exclude = $yumrepos::params::puppetlabs_deps_exclude,
) inherits yumrepos::params {

file { "/etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs":
ensure => present,
owner => root,
Expand All @@ -8,19 +20,23 @@
}

yumrepo { 'puppetlabs':
descr => 'Puppet Labs Products',
baseurl => "http://yum.puppetlabs.com/el/${::operatingsystemmajrelease}/products/${::architecture}",
enabled => '1',
gpgcheck => '1',
gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs",
require => File['/etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs'],
descr => 'Puppet Labs Products',
baseurl => $puppetlabs_products_url,
enabled => $puppetlabs_products_enabled,
includepkgs => $puppetlabs_products_includepkgs,
exclude => $puppetlabs_products_exclude,
gpgcheck => $puppetlabs_products_gpgcheck,
gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs",
require => File['/etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs'],
}

yumrepo { 'puppetlabs-deps':
descr => 'Puppet Labs Dependencies',
baseurl => "http://yum.puppetlabs.com/el/${::operatingsystemmajrelease}/dependencies/${::architecture}",
enabled => '1',
gpgcheck => '1',
baseurl => $puppetlabs_deps_url,
enabled => $puppetlabs_deps_enabled,
includepkgs => $puppetlabs_deps_includepkgs,
exclude => $puppetlabs_deps_exclude,
gpgcheck => $puppetlabs_deps_gpgcheck,
gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs",
require => File['/etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs'],
}
Expand Down
19 changes: 14 additions & 5 deletions manifests/varnish3.pp
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
class yumrepos::varnish3 {
class yumrepos::varnish3 (
$varnish3_url = $yumrepos::params::varnish3_url,
$varnish3_enabled = $yumrepos::params::varnish3_enabled,
$varnish3_gpgcheck = $yumrepos::params::varnish3_gpgcheck,
$varnish3_includepkgs = $yumrepos::params::varnish3_includepkgs,
$varnish3_exclude = $yumrepos::params::varnish3_exclude,
) inherits yumrepos::params {

yumrepo { 'varnish3':
descr => 'Varnish 3.0',
baseurl => "http://repo.varnish-cache.org/redhat/varnish-3.0/el${::operatingsystemmajrelease}/${::architecture}",
enabled => '1',
gpgcheck => '0',
descr => 'Varnish 3.0',
baseurl => $varnish3_url,
enabled => $varnish3_enabled,
includepkgs => $varnish3_includepkgs,
exclude => $varnish3_exclude,
gpgcheck => $varnish3_gpgcheck,
}
}

0 comments on commit 07aa8ba

Please sign in to comment.