Comments (5)
I need more information about your workflow and how you added / removed the repositories. If you want to remove some of the repositories you could use something like this:
[vagrant@centos-7 yum]$ cat data/common.yaml
---
yum::managed_repos:
- 'base'
- 'updates'
- 'extras'
- 'centosplus'
yum::repos:
base:
ensure: 'absent'
updates:
ensure: 'absent'
extras:
ensure: 'absent'
centosplus:
ensure: 'absent'
[vagrant@centos-7 yum]$ sudo /opt/puppetlabs/bin/puppet apply --modulepath=/home/vagrant/projects/modules -e 'include yum'
Notice: Compiled catalog for centos-7.vagrant.dev in environment production in 0.23 seconds
Notice: /Stage[main]/Yum/Yumrepo[base]/ensure: removed
Notice: /Stage[main]/Yum/Yumrepo[updates]/ensure: removed
Notice: /Stage[main]/Yum/Yumrepo[extras]/ensure: removed
Notice: /Stage[main]/Yum/Yumrepo[centosplus]/ensure: removed
Notice: Applied catalog in 0.15 seconds
from puppet-yum.
The repo removal process above is fine for managed repos, but what about the repos that are created by RPMs? (or naughty admins)
It causes significant issues in an environment that doesn't have Internet access, so we want to make sure that only "managed" repos are present. I guess its the difference between ensuring that one specific repo is present vs ensuring the repos are exactly what you want them to be.
Tommy
PS: We also tend to have to find all the modulexyz::manage_repo
type settings and make them false for the same reason.
from puppet-yum.
Hello,
I am also very interrested in the feature (just to let you know that you're not the only ones =p).
from puppet-yum.
Current workaround for us:
Hiera
profile::yum::disable_repos:
- CentOS-Base.repo
- CentOS-AppStream.repo
- CentOS-Extras.repo
Manifest
class profile::yum(
Array $disable_repos = [],
) {
# Disable some repos
$disable_repos.each | $file | {
exec { "mv /etc/yum.repos.d/$file /etc/yum.repos.d/$file.disabled-by-puppet":
onlyif => "test -f /etc/yum.repos.d/$file"
}
->
file { "/etc/yum.repos.d/$file":
ensure => absent,
}
# disable repos than configure some
Exec <| onlyif == "test -f /etc/yum.repos.d/$file" |> -> Yumrepo <| |>
}
}
from puppet-yum.
I am currently using crayfishx/purge module, which provides more granular options. For instance, you wouldn't want module to disable repositories managed by subscription-manager and not necessary to remove the repository, just disable it:
purge { 'yumrepo':
manage_property => 'enabled',
state => '0',
unless => ['baseurl', '=~', [$artifactory_url, $satellite_url]],
}
or hiera
purge::resources:
yumrepo:
unless:
- [ 'metalink', '=~', 'mirrors.fedoraproject.org' ]
from puppet-yum.
Related Issues (20)
- Invalid configuration value: failovermethod=priority HOT 1
- How I can achieve puppet only managed repositories? HOT 3
- Package name must be formatted as %{EPOCH}:%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}, not 'String'. HOT 2
- CentOS Stream9 support
- RHEL8, epel-modular is installed with the wrong repo-name
- Use of puppetlabs-yumrepo_core HOT 1
- [RFE] arguments for defined types (versionlock/post_transaction_actions)
- dnf install yum-utils fails on RHEL8 when modifying baseurl and metalink => absent HOT 2
- unnecessary whitespace in gpg key file paths
- GPG key for EPEL repository isn't getting installed before Package resource that requires EPEL repository. HOT 4
- Redhat yum repo certificates have expired
- yum_updates fact: too slow HOT 1
- Revert #258 that added purge_unmanaged_repos
- Exclude versionlocked updates in fact yum_package_updates/yum_has_updates HOT 1
- Add support for Sangoma HOT 1
- Failed to call refresh: '/usr/bin/package-cleanup --oldkernels --count=2 -y' returned 1 instead of one of [0] HOT 4
- `init.pp` does not support `group` param, so `yum::group` in hiera does nothing
- Support dnf module management
- CI tests fail for OracleLinux 7 HOT 1
- The first element of the merge has wrong type, expects a Hash value, got String
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from puppet-yum.