Giter Club home page Giter Club logo

yum-ius's Introduction

yum-ius Cookbook

Cookbook Version CI State OpenCollective OpenCollective License

The yum-ius cookbook takes over management of the default repositoryids that ship with CentOS systems. It allows attribute manipulation of ius, ius-debuginfo, ius-source, ius-archive, ius-archive-debuginfo, ius-archive-source, ius-testing, ius-testing-debuginfo, ius-testing-source

Requirements

Platforms

  • RHEL/CentOS and derivatives

Chef

  • Chef 12.14+

Cookbooks

  • yum-epel

Attributes

The following attributes are set by default

default['yum']['ius']['repositoryid'] = 'ius'
default['yum']['ius']['enabled'] = true
default['yum']['ius']['managed'] = true
default['yum']['ius']['failovermethod'] = 'priority'
default['yum']['ius']['gpgkey'] = "https://repo.ius.io/RPM-GPG-KEY-IUS-#{node['platform_version'].to_i}"
default['yum']['ius']['gpgcheck'] = true
default['yum']['ius']['description'] = "IUS Community Packages for Enterprise Linux #{node['platform_version'].to_i} - $basearch"
default['yum']['ius']['baseurl'] = "https://repo.ius.io/#{node['platform_version'].to_i}/$basearch"
default['yum']['ius-debuginfo']['repositoryid'] = 'ius-debuginfo'
default['yum']['ius-debuginfo']['enabled'] = false
default['yum']['ius-debuginfo']['managed'] = false
default['yum']['ius-debuginfo']['failovermethod'] = 'priority'
default['yum']['ius-debuginfo']['gpgkey'] = "https://repo.ius.io/RPM-GPG-KEY-IUS-#{node['platform_version'].to_i}"
default['yum']['ius-debuginfo']['gpgcheck'] = true
default['yum']['ius-debuginfo']['description'] = "IUS Community Packages for Enterprise Linux #{node['platform_version'].to_i} - $basearch Debug"
default['yum']['ius-debuginfo']['baseurl'] = "https://repo.ius.io/#{node['platform_version'].to_i}/$basearch/debug"
default['yum']['ius-source']['repositoryid'] = 'ius-source'
default['yum']['ius-source']['enabled'] = false
default['yum']['ius-source']['managed'] = false
default['yum']['ius-source']['failovermethod'] = 'priority'
default['yum']['ius-source']['gpgkey'] = "https://repo.ius.io/RPM-GPG-KEY-IUS-#{node['platform_version'].to_i}"
default['yum']['ius-source']['gpgcheck'] = true
default['yum']['ius-source']['description'] = "IUS Community Packages for Enterprise Linux #{node['platform_version'].to_i} - $basearch Source"
default['yum']['ius-source']['baseurl'] = "https://repo.ius.io/#{node['platform_version'].to_i}/src"
default['yum']['ius-archive']['repositoryid'] = 'ius-archive'
default['yum']['ius-archive']['enabled'] = false
default['yum']['ius-archive']['managed'] = false
default['yum']['ius-archive']['failovermethod'] = 'priority'
default['yum']['ius-archive']['gpgkey'] = "https://repo.ius.io/RPM-GPG-KEY-IUS-#{node['platform_version'].to_i}"
default['yum']['ius-archive']['gpgcheck'] = true
default['yum']['ius-archive']['description'] = "IUS Community Packages for Enterprise Linux #{node['platform_version'].to_i} - $basearch Archive"
default['yum']['ius-archive']['baseurl'] = "https://repo.ius.io/archive/#{node['platform_version'].to_i}/$basearch"
default['yum']['ius-archive-debuginfo']['repositoryid'] = 'ius-archive-debuginfo'
default['yum']['ius-archive-debuginfo']['enabled'] = false
default['yum']['ius-archive-debuginfo']['managed'] = false
default['yum']['ius-archive-debuginfo']['failovermethod'] = 'priority'
default['yum']['ius-archive-debuginfo']['gpgkey'] = "https://repo.ius.io/RPM-GPG-KEY-IUS-#{node['platform_version'].to_i}"
default['yum']['ius-archive-debuginfo']['gpgcheck'] = true
default['yum']['ius-archive-debuginfo']['description'] = "IUS Community Packages for Enterprise Linux #{node['platform_version'].to_i} - $basearch Archive Debug"
default['yum']['ius-archive-debuginfo']['baseurl'] = "https://repo.ius.io/archive/#{node['platform_version'].to_i}/$basearch/debug"
default['yum']['ius-archive-source']['repositoryid'] = 'ius-archive-source'
default['yum']['ius-archive-source']['enabled'] = false
default['yum']['ius-archive-source']['managed'] = false
default['yum']['ius-archive-source']['failovermethod'] = 'priority'
default['yum']['ius-archive-source']['gpgkey'] = "https://repo.ius.io/RPM-GPG-KEY-IUS-#{node['platform_version'].to_i}"
default['yum']['ius-archive-source']['gpgcheck'] = true
default['yum']['ius-archive-source']['description'] = "IUS Community Packages for Enterprise Linux #{node['platform_version'].to_i} - $basearch Archive Source"
default['yum']['ius-archive-source']['baseurl'] = "https://repo.ius.io/archive/#{node['platform_version'].to_i}/src"
default['yum']['ius-testing']['repositoryid'] = 'ius-testing'
default['yum']['ius-testing']['enabled'] = false
default['yum']['ius-testing']['managed'] = false
default['yum']['ius-testing']['failovermethod'] = 'priority'
default['yum']['ius-testing']['gpgkey'] = "https://repo.ius.io/RPM-GPG-KEY-IUS-#{node['platform_version'].to_i}"
default['yum']['ius-testing']['gpgcheck'] = true
default['yum']['ius-testing']['description'] = "IUS Community Packages for Enterprise Linux #{node['platform_version'].to_i} - $basearch Testing"
default['yum']['ius-testing']['baseurl'] = "https://repo.ius.io/testing/#{node['platform_version'].to_i}/$basearch"
default['yum']['ius-testing-debuginfo']['repositoryid'] = 'ius-testing-debuginfo'
default['yum']['ius-testing-debuginfo']['enabled'] = false
default['yum']['ius-testing-debuginfo']['managed'] = false
default['yum']['ius-testing-debuginfo']['failovermethod'] = 'priority'
default['yum']['ius-testing-debuginfo']['gpgkey'] = "https://repo.ius.io/RPM-GPG-KEY-IUS-#{node['platform_version'].to_i}"
default['yum']['ius-testing-debuginfo']['gpgcheck'] = true
default['yum']['ius-testing-debuginfo']['description'] = "IUS Community Packages for Enterprise Linux #{node['platform_version'].to_i} - $basearch Testing Debug"
default['yum']['ius-testing-debuginfo']['baseurl'] = "https://repo.ius.io/testing/#{node['platform_version'].to_i}/$basearch/debug"
default['yum']['ius-testing-source']['repositoryid'] = 'ius-testing-source'
default['yum']['ius-testing-source']['enabled'] = false
default['yum']['ius-testing-source']['managed'] = false
default['yum']['ius-testing-source']['failovermethod'] = 'priority'
default['yum']['ius-testing-source']['gpgkey'] = "https://repo.ius.io/RPM-GPG-KEY-IUS-#{node['platform_version'].to_i}"
default['yum']['ius-testing-source']['gpgcheck'] = true
default['yum']['ius-testing-source']['description'] = "IUS Community Packages for Enterprise Linux #{node['platform_version'].to_i} - $basearch Testing Source"
default['yum']['ius-testing-source']['baseurl'] = "https://repo.ius.io/testing/#{node['platform_version'].to_i}/src"

Recipes

  • default - Walks through node attributes and feeds a yum_resource parameters. The following is an example a resource generated by the recipe during compilation.
  yum_repository 'ius' do
    baseurl 'https://repo.ius.io/7/$basearch'
    description 'IUS Community Packages for Enterprise Linux 7 - $basearch'
    enabled true
    gpgcheck true
    gpgkey 'https://repo.ius.io/RPM-GPG-KEY-IUS-7'
  end

Usage Example

To disable the ius repository through a Role or Environment definition

default_attributes(
  :yum => {
    :ius => {
      :enabled => {
        false
       }
     }
   }
 )

Uncommonly used repositoryids are not managed by default. This is speeds up integration testing pipelines by avoiding yum-cache builds that nobody cares about. To enable the ius-testing repository with a wrapper cookbook, place the following in a recipe:

node.default['yum']['ius-tesing']['managed'] = true
node.default['yum']['ius-tesing']['enabled'] = true
include_recipe 'yum-ius'

More Examples

Point the base and debuginfo repositories at an internally hosted server.

node.default['yum']['ius']['enabled'] = true
node.default['yum']['ius']['mirrorlist'] = nil
node.default['yum']['ius']['baseurl'] = 'https://internal.example.com/centos/6/os/x86_64'
node.default['yum']['ius']['sslverify'] = false
node.default['yum']['ius-debuginfo']['enabled'] = true
node.default['yum']['ius-debuginfo']['mirrorlist'] = nil
node.default['yum']['ius-debuginfo']['baseurl'] = 'https://internal.example.com/centos/6/updates/x86_64'
node.default['yum']['ius-debuginfo']['sslverify'] = false

include_recipe 'yum-ius'

Contributors

This project exists thanks to all the people who contribute.

Backers

Thank you to all our backers!

https://opencollective.com/sous-chefs#backers

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website.

https://opencollective.com/sous-chefs/sponsor/0/website https://opencollective.com/sous-chefs/sponsor/1/website https://opencollective.com/sous-chefs/sponsor/2/website https://opencollective.com/sous-chefs/sponsor/3/website https://opencollective.com/sous-chefs/sponsor/4/website https://opencollective.com/sous-chefs/sponsor/5/website https://opencollective.com/sous-chefs/sponsor/6/website https://opencollective.com/sous-chefs/sponsor/7/website https://opencollective.com/sous-chefs/sponsor/8/website https://opencollective.com/sous-chefs/sponsor/9/website

yum-ius's People

Contributors

andytson avatar artofbugs avatar chasebolt avatar damacus avatar gsdevme avatar iennae avatar kitchen-porter avatar ramereth avatar renovate[bot] avatar tas50 avatar xorima avatar xorimabot avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yum-ius's Issues

IUS does not support Fedora

IUS does not support Fedora. I opened PR #8 before I noticed the CLA.

Also while Amazon isn't officially supported, it might work. Not sure it makes sense to keep it.

-Ben

Failure adding repositories

This cookbook fails with the error:

Expected process to exit with [0], but received '1'
---- Begin output of yum -q makecache --disablerepo=* --enablerepo=ius-source ----
STDOUT:
STDERR: Error: Cannot find a valid baseurl for repo: ius-source
---- End output of yum -q makecache --disablerepo=* --enablerepo=ius-source ----
Ran yum -q makecache --disablerepo=* --enablerepo=ius-source returned 1


Resource Declaration:
---------------------
# In /tmp/vagrant-chef-1/chef-solo-1/cookbooks/yum/providers/repository.rb

 49:   execute "yum-makecache-#{new_resource.repositoryid}" do
 50:     command "yum -q makecache --disablerepo=* --enablerepo=#{new_resource.repositoryid}"
 51:     action :nothing
 52:   end
 53:

Multiple converges and the error will not present but that is because in the provider the template block does not execute and notify the makecache block to execute.

Is this a base image problem or a configuration problem on my part or is this a genuine bug?

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • sous-chefs/.github 3.1.1
  • actions/checkout v4
  • actionshub/chef-install 3.0.0
  • actionshub/test-kitchen 3.0.0
.github/workflows/stale.yml
  • actions/stale v9

  • Check this box to trigger a request for Renovate to run again on this repository

Using this cookbook in Amazon Linux

Hi there,
I'd like to use this cookbook to add the IUS repo in an Amazon Linux 2015.03 so I can install the python33 package offered by IUS. I'm aware that the version of Amazon Linux I'm using adds a python34 package but for now I'd like to stick with Python 3.3.x as a precaution for the compatibility of my app.

Anyway, if I just add include_recipe "yum-ius::default" to my recipe, the Chef run fails with the following output:

[2015-05-21T11:34:14-04:00] ERROR: yum_repository[ius] (yum-ius::default line 36) had an error: Mixlib::ShellOut::ShellCommandFailed: execute[yum-makecache-ius] (/var/chef/cache/cookbooks/yum/providers/repository.rb line 55) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of yum -q makecache --disablerepo=* --enablerepo=ius ----
STDOUT:
STDERR: One of the configured repositories failed (Unknown),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Disable the repository, so yum won't use it by default. Yum will then
        just ignore the repository until you permanently enable it again or use
        --enablerepo for temporary usage:

            yum-config-manager --disable <repoid>

     4. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

Cannot find a valid baseurl for repo: ius
---- End output of yum -q makecache --disablerepo=* --enablerepo=ius ----
Ran yum -q makecache --disablerepo=* --enablerepo=ius returned 1

FWIW, the /etc/yum.repos.d/ius.repo file does get created:

% cat ius.repo
# This file was generated by Chef
# Do NOT modify this file by hand.

[ius]
name=Ye Ole Rpm Repo
enabled=1
failovermethod=priority
gpgcheck=1
gpgkey=http://dl.iuscommunity.org/pub/ius/IUS-COMMUNITY-GPG-KEY
sslverify=true

I'm guessing that the failure has to do with the ius.repo file missing a mirrorlist= line, but I only have vague theories as to why that is -- perhaps it's the IUS repo itself that's unable to support Amazon Linux, so the failure isn't really this cookbook's fault.

So anyway, I wanted to ask if that's actually expected, i.e. if Amazon Linux is basically unsupported for one reason or another. If so, that's fine -- just wanted to see if anyone knew anything about this.

Please merge the new CDN addresses. Old mirror list is offline.

Cookbook version

3.0.0

Chef-client version

14

Platform Details

CentOS

Scenario:

Unable to use ius repo as configured by this cookbook

Steps to Reproduce:

Install the ius repo from this package and attempt to install anything. The mirror list is gone.

Expected Result:

You should have the correct mirrorlist

Actual Result:

You have a list of mirrors that no longer exist.

There appears to be an unmerged PR with the new CDN that fixes this issue.

Reversed behavior of ["managed"] attribute in v0.4.3

Seems like v0.4.3 release should be revoked as soon as possible, because there is a broken behavior of ['yum-ius'][<repo_name>]['managed'] attributes.

Being set to true, this attribute means that the appropriate repo should be managed by the recipe. But due to 9694d27, this behavior have been reversed.

cc: @someara

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.