-
Notifications
You must be signed in to change notification settings - Fork 564
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify repository handling for distros
Moves to a single resource with variables instead of duplicated resources. It also updates the GPG keys to the current locations. Various previously hardcoded strings are now class parameters. They are still private classes and no guarantee is made on the forwards compatibility.
- Loading branch information
Showing
4 changed files
with
46 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,28 @@ | ||
# Class: jenkins::repo::debian | ||
# | ||
class jenkins::repo::debian | ||
{ | ||
class jenkins::repo::debian ( | ||
String $gpg_key_id = '150FDE3F7787E7D11EF4E12A9B7D32F2D50582E6', | ||
) { | ||
assert_private() | ||
|
||
include apt | ||
|
||
$pkg_host = 'https://pkg.jenkins.io' | ||
|
||
if $::jenkins::lts { | ||
apt::source { 'jenkins': | ||
location => "${pkg_host}/debian-stable", | ||
release => 'binary/', | ||
repos => '', | ||
include => { | ||
'src' => false, | ||
}, | ||
key => { | ||
'id' => '150FDE3F7787E7D11EF4E12A9B7D32F2D50582E6', | ||
'source' => "${pkg_host}/debian/jenkins-ci.org.key", | ||
}, | ||
} | ||
if $jenkins::lts { | ||
$location = "${jenkins::repo::base_url}/debian-stable" | ||
} else { | ||
$location = "${jenkins::repo::base_url}/debian" | ||
} | ||
else { | ||
apt::source { 'jenkins': | ||
location => "${pkg_host}/debian", | ||
release => 'binary/', | ||
repos => '', | ||
include => { | ||
'src' => false, | ||
}, | ||
key => { | ||
'id' => '150FDE3F7787E7D11EF4E12A9B7D32F2D50582E6', | ||
'source' => "${pkg_host}/debian/jenkins-ci.org.key", | ||
}, | ||
} | ||
|
||
apt::source { 'jenkins': | ||
location => $location, | ||
release => 'binary/', | ||
repos => '', | ||
include => { | ||
'src' => false, | ||
}, | ||
key => { | ||
'id' => $gpg_key_id, | ||
'source' => "${location}/${jenkins::repo::gpg_key_filename}", | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,20 @@ | ||
# Class: jenkins::repo::el | ||
# | ||
class jenkins::repo::el | ||
{ | ||
class jenkins::repo::el { | ||
assert_private() | ||
|
||
$repo_proxy = $::jenkins::repo_proxy | ||
|
||
if $::jenkins::lts { | ||
yumrepo {'jenkins': | ||
descr => 'Jenkins', | ||
baseurl => 'https://pkg.jenkins.io/redhat-stable/', | ||
gpgcheck => 1, | ||
gpgkey => 'https://pkg.jenkins.io/redhat/jenkins-ci.org.key', | ||
enabled => 1, | ||
proxy => $repo_proxy, | ||
} | ||
if $jenkins::lts { | ||
$baseurl = "${jenkins::repo::base_url}/redhat-stable/" | ||
} else { | ||
$baseurl = "${jenkins::repo::base_url}/redhat/" | ||
} | ||
|
||
else { | ||
yumrepo {'jenkins': | ||
descr => 'Jenkins', | ||
baseurl => 'https://pkg.jenkins.io/redhat/', | ||
gpgcheck => 1, | ||
gpgkey => 'https://pkg.jenkins.io/redhat/jenkins-ci.org.key', | ||
enabled => 1, | ||
proxy => $repo_proxy, | ||
} | ||
yumrepo {'jenkins': | ||
descr => 'Jenkins', | ||
baseurl => $baseurl, | ||
gpgcheck => 1, | ||
gpgkey => "${baseurl}${jenkins::repo::gpg_key_filename}", | ||
enabled => 1, | ||
proxy => $jenkins::repo_proxy, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,18 @@ | ||
# Class: jenkins::repo::suse | ||
# | ||
class jenkins::repo::suse | ||
{ | ||
class jenkins::repo::suse { | ||
assert_private() | ||
|
||
if $::jenkins::lts { | ||
zypprepo {'jenkins': | ||
descr => 'Jenkins', | ||
baseurl => 'https://pkg.jenkins.io/opensuse-stable/', | ||
gpgcheck => 1, | ||
gpgkey => 'https://pkg.jenkins.io/redhat/jenkins-ci.org.key', | ||
} | ||
if $jenkins::lts { | ||
$baseurl = "${jenkins::repo::base_url}/opensuse-stable/" | ||
} else { | ||
zypprepo {'jenkins': | ||
descr => 'Jenkins', | ||
baseurl => 'https://pkg.jenkins.io/opensuse/', | ||
gpgcheck => 1, | ||
gpgkey => 'https://pkg.jenkins.io/redhat/jenkins-ci.org.key', | ||
} | ||
$baseurl = "${jenkins::repo::base_url}/opensuse/" | ||
} | ||
|
||
zypprepo {'jenkins': | ||
descr => 'Jenkins', | ||
baseurl => $baseurl, | ||
gpgcheck => 1, | ||
gpgkey => "${baseurl}${jenkins::repo::gpg_key_filename}", | ||
} | ||
} |