Git Product home page Git Product logo

Comments (5)

dhoppe avatar dhoppe commented on July 30, 2024

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.

TJM avatar TJM commented on July 30, 2024

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.

geekix avatar geekix commented on July 30, 2024

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.

ThoTischner avatar ThoTischner commented on July 30, 2024

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.

vchepkov avatar vchepkov commented on July 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.