Repository Deployment OEL6,OEL5,RHEL5,RHEL6,
Hello All,
I am in the process of deploying *.repo files to oracle linux and a few red hat servers (we have solaris as well but that is another story). The problem i am facing is that the servers do not have access to the internet, and these servers have *.repo files from the existing operating system installation so when a package update runs it check all repos on the servers and timeout before it finally reaches the local repo (fails in some cases and make puppet out of sync with foreman). Is there a solution where subsequent puppet classes that are created can specify which repo file it can use. Please assist and bear in mind i suck at programming thank you in advance.
THE MANIFEST FOR THE REPOS
[root@foreman manifests]# cat init.pp
class repository{
case $operatingsystem {
OracleLinux, OEL: {
case $operatingsystemmajrelease {
"5": {
$repo_file = 'systeam.oel5.repo'
file { 'systeam.repo':
path => '/etc/yum.repos.d/systeam.repo',
ensure => file,
source => "puppet:///modules/repository/${repo_file}"
}
}
"6": {
$repo_file = 'systeam.oel6.repo'
file { 'systeam.repo':
path => '/etc/yum.repos.d/systeam.repo',
ensure => file,
source => "puppet:///modules/repository/${repo_file}"
}
}
}
}
Redhat: {
case $operatingsystemmajrelease {
"5": {
$repo_file = 'systeam.oel5.repo'
file { 'systeam.repo':
path => '/etc/yum.repos.d/systeam.repo',
ensure => file,
source => "puppet:///modules/repository/${repo_file}"
}
}
"6": {
$repo_file = 'systeam.oel6.repo'
file { 'systeam.repo':
path => '/etc/yum.repos.d/systeam.repo',
ensure => file,
source => "puppet:///modules/repository/${repo_file}"
}
}
}
}
CentOS: {
case $operatingsystemmajrelease {
"5": {
$repo_file = 'systeam.oel5.repo'
file { 'systeam.repo':
path => '/etc/yum.repos.d/systeam.repo',
ensure => file,
source => "puppet:///modules/repository/${repo_file}"
}
}
"6": {
$repo_file = 'systeam.oel6.repo'
file { 'systeam.repo':
path => '/etc/yum.repos.d/systeam.repo',
ensure => file,
source => "puppet:///modules/repository/${repo_file}"
}
}
}
}
default: {
fail("Unrecognized operating system")
}
}
}
==================================================================================
PACKAGE UPDATE CLASS
class bashupdate{
package { "bash":
provider => "yum",
ensure => "latest"
}
}