Update upstream cookbooks

This commit is contained in:
Greg Karékinian
2017-03-20 13:19:10 +00:00
parent bfd2d52ea8
commit bcfd44b923
340 changed files with 12576 additions and 5465 deletions

View File

@@ -0,0 +1 @@
~FC016

View File

@@ -1,81 +1,144 @@
# yum Cookbook CHANGELOG
This file is used to list changes made in each version of the yum cookbook.
## 5.0.0 (2017-02-12)
### Breaking changes
- Removed the yum_repository resource and instead require chef-client 12.14 or later, which has the yum repository functionality built in. This resolves Chef 13 compatibility warnings for any cookbook with the yum cookbook.
### Other changes
- Convert yum_globalconfig from an LWRP to a custom resource
## 4.2.0 (2017-02-12)
- Make cache in the DNF compat recipe
- Fix `fastestmirror_enabled`.
- Require Chef 12.1 not 12.0
- Convert to Inspec
## 4.1.0 (2016-10-21)
- Purge yum cache before removing a repo not after
## 4.0.0 (2016-09-06)
- Remove support for Chef 11
## 3.13.0 (2016-09-06)
- Add deprecation warning for add/remove actions, which were replaced with create/delete in Yum 3.0
- Remove support for Chef 10
## v3.12.0 (2016-08-25)
- Fixing baseurl to support multiple urls
- Modify releasever attribute for Amazon to match Amazon's default policy for releasever
## v3.11.0 (2016-06-01)
- Install yum at compile time in the dnf compatibility recipe
- Add IBM zlinux as a supported platform in the metadata
- Use cookstyle instead of rubocop to provide a consistent linting experience
## v3.10.0 (2016-02-04)
- Add a new sensitive attribute to the repository resource so prevent writing the diff of the config to Chef output / logs
- Update testing dependencies and remove the Guardfile / Guard dependencies
## v3.9.0 (2016-01-14)
- Added dnf_yum_compat recipe to ensure yum is installed on Fedora systems for Chef package resource compatibility. This will no longer be necessary when native dnf package support ships in chef-client.
## v3.8.2 (2015-10-28)
- #141 - Replace clean_headers with clean_metadata
- # 141 - Replace clean_headers with clean_metadata
## v3.8.1 (2015-10-28)
- Fixing up Chef13 deprecation warnings
## v3.8.0 (2015-10-13)
- adding clean_headers boolean property to yum_resource
- restoring Chef 10 backwards compat for the sake of ChefSpec
- (unique resource names needed to avoid cloning)
- Fixing localpkg_gpgcheck values
## v3.7.1 (2015-09-08)
- #135 - reverting "yum clean headers" as it breaks dnf compat
- # 135 - reverting "yum clean headers" as it breaks dnf compat
## v3.7.0 (2015-09-05)
- Adding deltarpm toggle
- Cleaning 'headers' rather than 'all'
## v3.6.3 (2015-07-13)
- Normalizing sslverify option rendering behavior
- Setting default value on the resource to nil
- Explictly setting string to render in template if value is supplied
- Behavior should default to "True", per man page
## v3.6.2 (2015-07-13)
- Adding -y to makecache, to import key when repo_gpgcheck = true.
- Accepting Integer value for max_retries
## v3.6.1 (2015-06-04)
- Executing yum clean before makecache
- Adding repo_gpgcheck
## v3.6.0 (2015-04-23)
- Adding "yum clean" before "yum makecache" in yum_repository :create
- Adding why_run support to yum_globalconfig
## v3.5.4 (2015-04-07)
- Changing tolerant config line to stringified integer
## v3.5.3 (2015-01-16)
- Adding reposdir to globalconfig template
## v3.5.2 (2014-12-24)
- Fixing redhat-release detection for Redhat 7
## v3.5.1 (2014-11-24)
- Reverting management of ca-certificates because EL5 was broken
## v3.5.0 (2014-11-24)
- Adding management of ca-certificates package to yum_repository provider
## v3.4.1 (2014-10-29)
- Run yum-makecache only_if new_resource.enabled
- Allow setting of reposdir in global yum config and man page
- Change default 'obsoletes' behavior to match yum defaults
## v3.4.0 (2014-10-15)
- Dynamically generate the new_resource attributes
## v3.3.2 (2014-09-11)
- Fix globalconfig resource param for http_caching
## v3.3.1 (2014-09-04)
- Fix issue with sslverify if set to false
- Add fancy badges
## v3.3.0 (2014-09-03)
- Adding tuning attributes for all supported resource parameters
- Adding options hash parameter
- Adding (real) rhel-6.5 and centos-7.0 to test-kitchen coverage
@@ -87,27 +150,35 @@ This file is used to list changes made in each version of the yum cookbook.
- Adding mode parameter to repository resource. Defaults to '0644'.
## v3.2.4 (2014-08-20)
- #82 - Adding a makecache parameter
- # 82 - Adding a makecache parameter
## v3.2.2 (2014-06-11)
- #77 - Parameter default to be Trueclass instead of "1"
- #78 - add releasever parameter
- # 77 - Parameter default to be Trueclass instead of "1"
- # 78 - add releasever parameter
## v3.2.0 (2014-04-09)
- [COOK-4510] - Adding username and password parameters to node attributes
- [COOK-4518] - Fix Scientific Linux distroverpkg
## v3.1.6 (2014-03-27)
- [COOK-4463] - support multiple GPG keys
- [COOK-4364] - yum_repository delete action fails
## v3.1.4 (2014-03-12)
- [COOK-4417] Expand test harness to encompass 32-bit boxes
## v3.1.2 (2014-02-23)
Fixing bugs around :delete action and cache clean Fixing specs to cover :remove and :delete aliasing properly Adding Travis-ci build matrix bits
## v3.1.0 (2014-02-13)
- Updating testing harness for integration testing on Travis-ci
- Adding TESTING.md and Guardfile
- PR #67 - Add skip_if_unvailable repository option
@@ -118,60 +189,82 @@ Fixing bugs around :delete action and cache clean Fixing specs to cover :remove
- Adding support for custom source template to yum_repository
## v3.0.8 (2014-01-27)
Fixing typo in default.rb. yum_globalconfig now passes proxy attribute correctly.
## v3.0.6 (2014-01-27)
Updating default.rb to consume node['yum']['main']['proxy']
## v3.0.4 (2013-12-29)
### Bug
- **[COOK-4156](https://tickets.chef.io/browse/COOK-4156)** - yum cookbook creates a yum.conf with "cachefir" directive
## v3.0.2
Updating globalconfig provider for Chef 10 compatability
## v3.0.0
3.0.0 Major rewrite with breaking changes. Recipes broken out into individual cookbooks yum_key resource has been removed yum_repository resource now takes gpgkey as a URL directly yum_repository actions have been reduced to :create and :delete 'name' has been changed to repositoryid to avoid ambiguity chefspec test coverage gpgcheck is set to 'true' by default and must be explicitly disabled
## v2.4.4
Reverting to Ruby 1.8 hash syntax.
## v2.4.2
[COOK-3275] LWRP repository.rb :add method fails to create yum repo in some cases which causes :update to fail Amazon rhel
## v2.4.0
### Improvement
- [COOK-3025] - Allow per-repo proxy definitions
## v2.3.4
### Improvement
- **[COOK-3689](https://tickets.chef.io/browse/COOK-3689)** - Fix warnings about resource cloning
- **[COOK-3574](https://tickets.chef.io/browse/COOK-3574)** - Add missing "description" field in metadata
## v2.3.2
### Bug
- **[COOK-3145](https://tickets.chef.io/browse/COOK-3145)** - Use correct download URL for epel `key_url`
## v2.3.0
### New Feature
- [COOK-2924]: Yum should allow type setting in repo file
## v2.2.4
### Bug
- [COOK-2360]: last commit to `yum_repository` changes previous behaviour
- [COOK-3015]: Yum cookbook test minitest to fail
## v2.2.2
### Improvement
- [COOK-2741]: yum::elrepo
- [COOK-2946]: update tests, test kitchen support in yum cookbook
### Bug
- [COOK-2639]: Yum cookbook - epel - always assumes url is a mirror list
- [COOK-2663]: Yum should allow metadata_expire setting in repo file
- [COOK-2751]: Update yum.ius_release version to 1.0-11
## v2.2.0
- [COOK-2189] - yum::ius failed on install (caused from rpm dependency)
- [COOK-2196] - Make includepkgs and exclude configurable for each repos
- [COOK-2244] - Allow configuring caching using attributes
@@ -181,43 +274,55 @@ Reverting to Ruby 1.8 hash syntax.
- [COOK-2643] - don't use conditional attribute for `yum_key` `remote_file`
## v2.1.0
- [COOK-2045] - add remi repository recipe
- [COOK-2121] - add `:create` action to `yum_repository`
## v2.0.6
- [COOK-2037] - minor style fixes
- [COOK-2038] - updated README
## v2.0.4
- [COOK-1908] - unable to install repoforge on CentOS 6 32 bit
## v2.0.2
- [COOK-1758] - Add default action for repository resource
## v2.0.0
This version changes the behavior of the EPEL recipe (most commonly used in other Chef cookbooks) on Amazon, and removes an attribute, `node['yum']['epel_release']`. See the README for details.
- [COOK-1772] - Simplify management of EPEL with LWRP
## v1.0.0
`mirrorlist` in the `yum_repository` LWRP must be set to the mirror list URI to use rather than setting it to true. See README.md.
- [COOK-1088] - use dl.fedoraproject.org for EPEL to prevent redirects
- [COOK-1653] - fix mirrorlist
- [COOK-1710] - support http proxy
- [COOK-1722] - update IUS version
## v0.8.2
- [COOK-1521] - add :update action to `yum_repository`
## v0.8.0
- [COOK-1204] - Make 'add' default action for yum_repository
- [COOK-1351] - option to not make the yum cache (via attribute)
- [COOK-1353] - x86_64 centos path fixes
- [COOK-1414] - recipe for repoforge
## v0.6.2
- Updated README to remove git diff artifacts.
## v0.6.0
- Default action for the yum_repository LWRP is now add.
- [COOK-1227] - clear Chefs internal cache after adding new yum repo
- [COOK-1262] - yum::epel should enable existing repo on Amazon Linux
@@ -226,11 +331,14 @@ This version changes the behavior of the EPEL recipe (most commonly used in othe
- [COOK-1346] - retry remote_file for EPEL in case we get an FTP mirror
## v0.5.2
- [COOK-825] - epel and ius `remote_file` should notify the `rpm_package` to install
## v0.5.0
- [COOK-675] - add recipe for handling EPEL repository
- [COOK-722] - add recipe for handling IUS repository
## v.0.1.2
- Remove yum update in default recipe, that doesn't update caches, it updates packages installed.

View File

@@ -1,16 +1,13 @@
<!-- This is a generated file. Please do not edit directly -->
# Maintainers
This file lists how this cookbook project is maintained. When making changes to the system, this
file tells you who needs to review your patch - you need a simple majority of maintainers
for the relevant subsystems to provide a :+1: on your pull request. Additionally, you need
to not receive a veto from a Lieutenant or the Project Lead.
Check out [How Cookbooks are Maintained](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD)
for details on the process and how to become a maintainer or the project lead.
This file lists how this cookbook project is maintained. When making changes to the system, this file tells you who needs to review your patch - you need a review from an existing maintainer for the cookbook to provide a :+1: on your pull request. Additionally, you need to not receive a veto from a Lieutenant or the Project Lead.
Check out [How Cookbooks are Maintained](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD) for details on the process and how to become a maintainer or the project lead.
# Project Maintainer
* [Sean OMeara](https://github.com/someara)
* [Tim Smith](https://github.com/tas50)
# Maintainers
* [Jennifer Davis](https://github.com/sigje)

View File

@@ -1,95 +1,28 @@
# yum Cookbook
[![Build Status](https://travis-ci.org/chef-cookbooks/yum.svg?branch=master)](http://travis-ci.org/chef-cookbooks/yum) [![Cookbook Version](https://img.shields.io/cookbook/v/yum.svg)](https://supermarket.chef.io/cookbooks/yum) [![Code Climate](https://codeclimate.com/github/chef-cookbooks/yum/badges/gpa.svg)](https://codeclimate.com/github/chef-cookbooks/yum)
The Yum cookbook exposes the `yum_globalconfig` and `yum_repository` resources that allows a user to both control global behavior and make individual Yum repositories available for use. These resources aim to allow the user to configure all options listed in the `yum.conf` man page, found at [http://linux.die.net/man/5/yum.conf](http://linux.die.net/man/5/yum.conf)
[![Build Status](https://travis-ci.org/chef-cookbooks/yum.svg?branch=master)](http://travis-ci.org/chef-cookbooks/yum) [![Cookbook Version](https://img.shields.io/cookbook/v/yum.svg)](https://supermarket.chef.io/cookbooks/yum)
## NOTES
WARNING: Yum cookbook version 3.0.0 and above contain non-backwards compatible breaking changes and will not work with cookbooks written against the 2.x and 1.x series. Changes have been made to the yum_repository resource, and the yum_key resource has been eliminated entirely. Recipes have been eliminated and moved into their own cookbooks. Please lock yum to the 2.x series in your Chef environments until all dependent cookbooks have been ported.
The Yum cookbook exposes the `yum_globalconfig` resource which allows a user to control global yum behavior. This resources aims to allow the user to configure all options listed in the `yum.conf` man page, found at <http://linux.die.net/man/5/yum.conf>
## Requirements
### Platforms
- RHEL/CentOS and derivatives
- Fedora
### Chef
- Chef 11+
- Chef 12.14+
### Cookbooks
- none
## Resources/Providers
### yum_repository
This resource manages a yum repository configuration file at /etc/yum.repos.d/`repositoryid`.repo. When the file needs to be repaired, it calls yum-makecache so packages in the repo become available to the next resource.
#### Example
```ruby
# add the Zenoss repository
yum_repository 'zenoss' do
description "Zenoss Stable repo"
baseurl "http://dev.zenoss.com/yum/stable/"
gpgkey 'http://dev.zenoss.com/yum/RPM-GPG-KEY-zenoss'
action :create
end
# add the EPEL repo
yum_repository 'epel' do
description 'Extra Packages for Enterprise Linux'
mirrorlist 'http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=$basearch'
gpgkey 'http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6'
action :create
end
```
```ruby
# delete CentOS-Media repo
yum_repository 'CentOS-Media' do
action :delete
end
```
#### Actions
- `:create` - creates a repository file and builds the repository listing
- `:delete` - deletes the repository file
- `:makecache` - update yum cache
#### Parameters
- `baseurl` - Must be a URL to the directory where the yum repository's 'repodata' directory lives. Can be an http://, ftp:// or file:// URL. You can specify multiple URLs in one baseurl statement.
- `cost` - relative cost of accessing this repository. Useful for weighing one repo's packages as greater/less than any other. defaults to 1000
- `clean_metadata` - Run "yum clean metadata <reponame>" during repository creation. defaults to true.
- `description` - Maps to the 'name' parameter in a repository .conf. Descriptive name for the repository channel. This directive must be specified.
- `enabled` - Either `true` or `false`. This tells yum whether or not use this repository.
- `enablegroups` - Either `true` or `false`. Determines whether yum will allow the use of package groups for this repository. Default is `true` (package groups are allowed).
- `exclude` - List of packages to exclude from updates or installs. This should be a space separated list in a single string. Shell globs using wildcards (eg. * and ?) are allowed.
- `failovermethod` - Either 'roundrobin' or 'priority'.
- `fastestmirror_enabled` - Either `true` or `false`
- `gpgcheck` - Either `true` or `false`. This tells yum whether or not it should perform a GPG signature check on packages. When this is set in the [main] section it sets the default for all repositories. The default is `true`.
- `gpgkey` - A URL pointing to the ASCII-armored GPG key file for the repository. This option is used if yum needs a public key to verify a package and the required key hasn't been imported into the RPM database. If this option is set, yum will automatically import the key from the specified URL.
- `http_caching` - Either 'all', 'packages', or 'none'. Determines how upstream HTTP caches are instructed to handle any HTTP downloads that Yum does. Defaults to 'all'
- `includepkgs` - Inverse of exclude. This is a list of packages you want to use from a repository. If this option lists only one package then that is all yum will ever see from the repository. Defaults to an empty list.
- `keepalive` - Either `true` or `false`. This tells yum whether or not HTTP/1.1 keepalive should be used with this repository.
- `make_cache` - Optional, Default is `true`, if `false` then `yum -q makecache` will not be ran
- `max_retries` - Set the number of times any attempt to retrieve a file should retry before returning an error. Setting this to '0' makes yum try forever. Default is '10'.
- `metadata_expire` - Time (in seconds) after which the metadata will expire. So that if the current metadata downloaded is less than this many seconds old then yum will not update the metadata against the repository. If you find that yum is not downloading information on updates as often as you would like lower the value of this option. You can also change from the default of using seconds to using days, hours or minutes by appending a d, h or m respectively. The default is 6 hours, to compliment yum-updatesd running once an hour. It's also possible to use the word "never", meaning that the metadata will never expire. Note that when using a metalink file the metalink must always be newer than the metadata for the repository, due to the validation, so this timeout also applies to the metalink file.
- `mirrorlist` - Specifies a URL to a file containing a list of baseurls. This can be used instead of or with the baseurl option. Substitution variables, described below, can be used with this option. As a special hack is the mirrorlist URL contains the word "metalink" then the value of mirrorlist is copied to metalink (if metalink is not set)
- `mirror_expire` - Time (in seconds) after which the mirrorlist locally cached will expire. If the current mirrorlist is less than this many seconds old then yum will not download another copy of the mirrorlist, it has the same extra format as metadata_expire. If you find that yum is not downloading the mirrorlists as often as you would like lower the value of this option.
- `mirrorlist_expire` - alias for mirror_expire
- `mode` - Permissions mode of .repo file on disk. Useful for scenarios where secrets are in the repo file. If set to '600', normal users will not be able to use yum search, yum info, etc. Defaults to '0644'
- `priority` - When the yum-priorities plug-in is enabled, you set priorities on repository entries, where N is an integer from 1 to 99. The default priority for repositories is 99.
- `proxy` - URL to the proxy server that yum should use.
- `proxy_username` - username to use for proxy
- `proxy_password` - password for this proxy
- `report_instanceid` - Report instance ID when using Amazon Linux AMIs and repositories
- `repositoryid` - Must be a unique name for each repository, one word. Defaults to name attribute.
- `sensitive` - Optional, Default is `false`, if `true` then content of repository file is hidden from chef run output.
- `source` - Use a custom template source instead of the default one in the yum cookbook
- `sslcacert` - Path to the directory containing the databases of the certificate authorities yum should use to verify SSL certificates. Defaults to none - uses system default
- `sslclientcert` - Path to the SSL client certificate yum should use to connect to repos/remote sites Defaults to none.
- `sslclientkey` - Path to the SSL client key yum should use to connect to repos/remote sites Defaults to none.
- `sslverify` - Either `true` or `false`. Determines if yum will verify SSL certificates/hosts. Defaults to `true`
- `timeout` - Number of seconds to wait for a connection before timing out. Defaults to 30 seconds. This may be too short of a time for extremely overloaded sites.
## Resources
### yum_globalconfig
This renders a template with global yum configuration parameters. The default recipe uses it to render `/etc/yum.conf`. It is flexible enough to be used in other scenarios, such as building RPMs in isolation by modifying `installroot`.
#### Example
@@ -104,22 +37,30 @@ yum_globalconfig '/my/chroot/etc/yum.conf' do
end
```
#### Parameters
`yum_globalconfig` can take most of the same parameters as a `yum_repository`, plus more, too numerous to describe here. Below are a few of the more commonly used ones. For a complete list, please consult the `yum.conf` man page, found here: [http://linux.die.net/man/5/yum.conf](http://linux.die.net/man/5/yum.conf)
#### Properties
`yum_globalconfig` can take most of the same parameters as a `yum_repository`, plus more, too numerous to describe here. Below are a few of the more commonly used ones. For a complete list, please consult the `yum.conf` man page, found here: <http://linux.die.net/man/5/yum.conf>
- `cachedir` - Directory where yum should store its cache and db files. The default is '/var/cache/yum'.
- `keepcache` - Either `true` or `false`. Determines whether or not yum keeps the cache of headers and packages after successful installation. Default is `false`
- `debuglevel` - Debug message output level. Practical range is 0-10. Default is '2'.
- `debuglevel` - Debug message output level. Practical range is 0-10\. Default is '2'.
- `exclude` - List of packages to exclude from updates or installs. This should be a space separated list. Shell globs using wildcards (eg. * and ?) are allowed.
- `installonlypkgs` = List of package provides that should only ever be installed, never updated. Kernels in particular fall into this category. Defaults to kernel, kernel-bigmem, kernel-enterprise, kernel-smp, kernel-debug, kernel-unsupported, kernel-source, kernel-devel, kernel-PAE, kernel-PAE-debug.
- `logfile` - Full directory and file name for where yum should write its log file.
- `exactarch` - Either `true` or `false`. Set to `true` to make 'yum update' only update the architectures of packages that you have installed. ie: with this enabled yum will not install an i686 package to update an x86_64 package. Default is `true`
- `exactarch` - Either `true` or `false`. Set to `true` to make 'yum update' only update the architectures of packages that you have installed. ie: with this enabled yum will not install an i686 package to update an x86_64 package. Default is `true`
- `gpgcheck` - Either `true` or `false`. This tells yum whether or not it should perform a GPG signature check on the packages gotten from this repository.
### yum_repository
This resource is now provided by chef-client 12.14 and later and has been removed from this cookbook. If you require this resource we highly recommend upgrading your chef-client, but if that is not an option you can pin the 4.X yum cookbook.
## Recipes
- `default` - Configures `yum_globalconfig[/etc/yum.conf]` with values found in node attributes at `node['yum']['main']`
- `dnf_yum_compat` - Installs the yum package using dnf on Fedora systems to provide support for the package resource in recipes. This is necessary as Chef does not yet (as of Q4 2015) have native support for DNF. This recipe should be 1st on a Fedora runlist
- `dnf_yum_compat` - Installs the yum package using dnf on Fedora systems to provide support for the package resource in recipes. This is necessary on chef-client < 12.18\. This recipe should be 1st on a Fedora runlist
## Attributes
The following attributes are set by default
```ruby
@@ -135,8 +76,16 @@ default['yum']['main']['installonlypkgs'] = nil
default['yum']['main']['installroot'] = nil
```
For Amazon platform nodes,
```ruby
default['yum']['main']['releasever'] = 'latest'
```
## Related Cookbooks
Recipes from older versions of this cookbook have been moved individual cookbooks. Recipes for managing platform yum configurations and installing specific repositories can be found in one (or more!) of the following cookbook.
- yum-centos
- yum-fedora
- yum-amazon
@@ -148,9 +97,11 @@ Recipes from older versions of this cookbook have been moved individual cookbook
- yum-pgdg
## Usage
Put `depends 'yum'` in your metadata.rb to gain access to the yum_repository resource.
## License & Authors
- Author:: Eric G. Wolfe
- Author:: Matt Ray ([matt@chef.io](mailto:matt@chef.io))
- Author:: Joshua Timberman ([joshua@chef.io](mailto:joshua@chef.io))
@@ -158,7 +109,7 @@ Put `depends 'yum'` in your metadata.rb to gain access to the yum_repository res
```text
Copyright:: 2011 Eric G. Wolfe
Copyright:: 2013-2016 Chef Software, Inc.
Copyright:: 2013-2017 Chef Software, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -16,7 +16,11 @@ default['yum']['main']['distroverpkg'] = case node['platform']
else
"#{node['platform']}-release"
end
# default["yum"]["main"]["releasever"] = nil # /.*/
default['yum']['main']['releasever'] = case node['platform']
when 'amazon'
'latest'
end
default['yum']['main']['alwaysprompt'] = nil # [TrueClass, FalseClass]
default['yum']['main']['assumeyes'] = nil # [TrueClass, FalseClass]
default['yum']['main']['bandwidth'] = nil # /^\d+$/
@@ -78,7 +82,6 @@ default['yum']['main']['proxy_password'] = nil # /.*/
default['yum']['main']['proxy_username'] = nil # /.*/
default['yum']['main']['password'] = nil # /.*/
default['yum']['main']['recent'] = nil # /^\d+$/
default['yum']['main']['releasever'] = nil # /.*/
default['yum']['main']['repo_gpgcheck'] = nil # [TrueClass, FalseClass]
default['yum']['main']['reposdir'] = nil # /.*/
default['yum']['main']['reset_nice'] = nil # [TrueClass, FalseClass]

View File

@@ -1,22 +1,4 @@
# Matchers for chefspec 3
if defined?(ChefSpec)
def create_yum_repository(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:yum_repository, :create, resource_name)
end
def add_yum_repository(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:yum_repository, :add, resource_name)
end
def delete_yum_repository(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:yum_repository, :delete, resource_name)
end
def remove_yum_repository(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:yum_repository, :remove, resource_name)
end
def create_yum_globalconfig(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:yum_globalconfig, :create, resource_name)
end

View File

@@ -1 +1 @@
{"name":"yum","version":"3.10.0","description":"Configures various yum components on Red Hat-like systems","long_description":"","maintainer":"Chef Software, Inc.","maintainer_email":"cookbooks@chef.io","license":"Apache 2.0","platforms":{"amazon":">= 0.0.0","centos":">= 0.0.0","fedora":">= 0.0.0","oracle":">= 0.0.0","redhat":">= 0.0.0","scientific":">= 0.0.0"},"dependencies":{},"recommendations":{},"suggestions":{},"conflicting":{},"providing":{},"replacing":{},"attributes":{},"groupings":{},"recipes":{}}
{"name":"yum","version":"5.0.0","description":"Configures various yum components on Red Hat-like systems","long_description":"","maintainer":"Chef Software, Inc.","maintainer_email":"cookbooks@chef.io","license":"Apache 2.0","platforms":{"amazon":">= 0.0.0","centos":">= 0.0.0","fedora":">= 0.0.0","oracle":">= 0.0.0","redhat":">= 0.0.0","scientific":">= 0.0.0","zlinux":">= 0.0.0"},"dependencies":{},"recommendations":{},"suggestions":{},"conflicting":{},"providing":{},"replacing":{},"attributes":{},"groupings":{},"recipes":{}}

View File

@@ -1,41 +0,0 @@
#
# Cookbook Name:: yum
# Provider:: repository
#
# Author:: Sean OMeara <someara@chef.io>
# Copyright 2013, Chef
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Allow for Chef 10 support
use_inline_resources if defined?(use_inline_resources)
def whyrun_supported?
true
end
action :create do
template new_resource.path do
source 'main.erb'
cookbook 'yum'
mode '0644'
variables(config: new_resource)
end
end
action :delete do
file new_resource.path do
action :delete
end
end

View File

@@ -1,114 +0,0 @@
#
# Cookbook Name:: yum
# Provider:: repository
#
# Author:: Sean OMeara <someara@chef.io>
# Copyright 2013, Chef
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# In Chef 11 and above, calling the use_inline_resources method will
# make Chef create a new "run_context". When an action is called, any
# nested resources are compiled and converged in isolation from the
# recipe that calls it.
# Allow for Chef 10 support
use_inline_resources if defined?(use_inline_resources)
def whyrun_supported?
true
end
action :create do
# Hack around the lack of "use_inline_resources" before Chef 11 by
# uniquely naming the execute[yum-makecache] resources. Set the
# notifies timing to :immediately for the same reasons. Remove both
# of these when dropping Chef 10 support.
if new_resource.clean_headers
Chef::Log.warn <<-eos
Use of `clean_headers` in resource yum[#{new_resource.repositoryid}] is now deprecated and will be removed in a future release.
`clean_metadata` should be used instead
eos
end
template "/etc/yum.repos.d/#{new_resource.repositoryid}.repo" do
if new_resource.source.nil?
source 'repo.erb'
cookbook 'yum'
else
source new_resource.source
end
mode new_resource.mode
sensitive new_resource.sensitive
variables(config: new_resource)
if new_resource.make_cache
notifies :run, "execute[yum clean metadata #{new_resource.repositoryid}]", :immediately if new_resource.clean_metadata || new_resource.clean_headers
notifies :run, "execute[yum-makecache-#{new_resource.repositoryid}]", :immediately
notifies :create, "ruby_block[yum-cache-reload-#{new_resource.repositoryid}]", :immediately
end
end
execute "yum clean metadata #{new_resource.repositoryid}" do
command "yum clean metadata --disablerepo=* --enablerepo=#{new_resource.repositoryid}"
action :nothing
end
# get the metadata for this repo only
execute "yum-makecache-#{new_resource.repositoryid}" do
command "yum -q -y makecache --disablerepo=* --enablerepo=#{new_resource.repositoryid}"
action :nothing
only_if { new_resource.enabled }
end
# reload internal Chef yum cache
ruby_block "yum-cache-reload-#{new_resource.repositoryid}" do
block { Chef::Provider::Package::Yum::YumCache.instance.reload }
action :nothing
end
end
action :delete do
file "/etc/yum.repos.d/#{new_resource.repositoryid}.repo" do
action :delete
notifies :run, "execute[yum clean all #{new_resource.repositoryid}]", :immediately
notifies :create, "ruby_block[yum-cache-reload-#{new_resource.repositoryid}]", :immediately
end
execute "yum clean all #{new_resource.repositoryid}" do
command "yum clean all --disablerepo=* --enablerepo=#{new_resource.repositoryid}"
only_if "yum repolist | grep -P '^#{new_resource.repositoryid}([ \t]|$)'"
action :nothing
end
ruby_block "yum-cache-reload-#{new_resource.repositoryid}" do
block { Chef::Provider::Package::Yum::YumCache.instance.reload }
action :nothing
end
end
action :makecache do
execute "yum-makecache-#{new_resource.repositoryid}" do
command "yum -q makecache --disablerepo=* --enablerepo=#{new_resource.repositoryid}"
action :run
end
ruby_block "yum-cache-reload-#{new_resource.repositoryid}" do
block { Chef::Provider::Package::Yum::YumCache.instance.reload }
action :run
end
end
alias_method :action_add, :action_create
alias_method :action_remove, :action_delete

View File

@@ -3,7 +3,7 @@
# Author:: Joshua Timberman (<joshua@chef.io>)
# Recipe:: yum::default
#
# Copyright 2013-2014, Chef Software, Inc (<legal@chef.io>)
# Copyright:: 2013-2016, Chef Software, Inc (<legal@chef.io>)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View File

@@ -2,7 +2,7 @@
# Author:: Tim Smith (<tsmith@chef.io>)
# Recipe:: yum::fedora_yum_compat
#
# Copyright 2015, Chef Software, Inc (<legal@chef.io>)
# Copyright:: 2015-2016, Chef Software, Inc (<legal@chef.io>)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -16,8 +16,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
execute 'make yum cache' do
command 'yum makecache'
action :nothing
end
execute 'install yum' do
command 'dnf install yum -y'
not_if { ::File.exist?('/var/lib/yum') }
action :run
end
action :nothing
notifies :run, 'execute[make yum cache]', :immediately
end.run_action(:run)

View File

@@ -1,9 +1,9 @@
#
# Cookbook Name:: yum
# Cookbook:: yum
# Resource:: repository
#
# Author:: Sean OMeara <someara@chef.io>
# Copyright 2013, Chef
# Copyright:: 2013-2017, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -18,92 +18,102 @@
# limitations under the License.
#
actions :create, :delete
default_action :create
# http://linux.die.net/man/5/yum.conf
attribute :alwaysprompt, kind_of: [TrueClass, FalseClass], default: nil
attribute :assumeyes, kind_of: [TrueClass, FalseClass], default: nil
attribute :bandwidth, kind_of: String, regex: /^\d+/, default: nil
attribute :bugtracker_url, kind_of: String, regex: /.*/, default: nil
attribute :clean_requirements_on_remove, kind_of: [TrueClass, FalseClass], default: nil
attribute :cachedir, kind_of: String, regex: /.*/, default: '/var/cache/yum/$basearch/$releasever'
attribute :color, kind_of: String, equal_to: %w(always never), default: nil
attribute :color_list_available_downgrade, kind_of: String, regex: /.*/, default: nil
attribute :color_list_available_install, kind_of: String, regex: /.*/, default: nil
attribute :color_list_available_reinstall, kind_of: String, regex: /.*/, default: nil
attribute :color_list_available_upgrade, kind_of: String, regex: /.*/, default: nil
attribute :color_list_installed_extra, kind_of: String, regex: /.*/, default: nil
attribute :color_list_installed_newer, kind_of: String, regex: /.*/, default: nil
attribute :color_list_installed_older, kind_of: String, regex: /.*/, default: nil
attribute :color_list_installed_reinstall, kind_of: String, regex: /.*/, default: nil
attribute :color_search_match, kind_of: String, regex: /.*/, default: nil
attribute :color_update_installed, kind_of: String, regex: /.*/, default: nil
attribute :color_update_local, kind_of: String, regex: /.*/, default: nil
attribute :color_update_remote, kind_of: String, regex: /.*/, default: nil
attribute :commands, kind_of: String, regex: /.*/, default: nil
attribute :debuglevel, kind_of: String, regex: /^\d+$/, default: '2'
attribute :deltarpm, kind_of: [TrueClass, FalseClass], default: nil
attribute :diskspacecheck, kind_of: [TrueClass, FalseClass], default: nil
attribute :distroverpkg, kind_of: String, regex: /.*/, default: nil
attribute :enable_group_conditionals, kind_of: [TrueClass, FalseClass], default: nil
attribute :errorlevel, kind_of: String, regex: /^\d+$/, default: nil
attribute :exactarch, kind_of: [TrueClass, FalseClass], default: true
attribute :exclude, kind_of: String, regex: /.*/, default: nil
attribute :gpgcheck, kind_of: [TrueClass, FalseClass], default: true
attribute :group_package_types, kind_of: String, regex: /.*/, default: nil
attribute :groupremove_leaf_only, kind_of: [TrueClass, FalseClass], default: nil
attribute :history_list_view, kind_of: String, equal_to: %w(users commands single-user-commands), default: nil
attribute :history_record, kind_of: [TrueClass, FalseClass], default: nil
attribute :history_record_packages, kind_of: String, regex: /.*/, default: nil
attribute :http_caching, kind_of: String, equal_to: %w(packages all none), default: nil
attribute :installonly_limit, kind_of: String, regex: [/^\d+/, /keep/], default: '3'
attribute :installonlypkgs, kind_of: String, regex: /.*/, default: nil
attribute :installroot, kind_of: String, regex: /.*/, default: nil
attribute :keepalive, kind_of: [TrueClass, FalseClass], default: nil
attribute :keepcache, kind_of: [TrueClass, FalseClass], default: false
attribute :kernelpkgnames, kind_of: String, regex: /.*/, default: nil
attribute :localpkg_gpgcheck, kind_of: [TrueClass, FalseClass], default: nil
attribute :logfile, kind_of: String, regex: /.*/, default: '/var/log/yum.log'
attribute :max_retries, kind_of: String, regex: /^\d+$/, default: nil
attribute :mdpolicy, kind_of: String, equal_to: %w(instant group:primary group:small group:main group:all), default: nil
attribute :metadata_expire, kind_of: String, regex: [/^\d+$/, /^\d+[mhd]$/, /never/], default: nil
attribute :mirrorlist_expire, kind_of: String, regex: /^\d+$/, default: nil
attribute :multilib_policy, kind_of: String, equal_to: %w(all best), default: nil
attribute :obsoletes, kind_of: [TrueClass, FalseClass], default: nil
attribute :overwrite_groups, kind_of: [TrueClass, FalseClass], default: nil
attribute :password, kind_of: String, regex: /.*/, default: nil
attribute :path, kind_of: String, regex: /.*/, name_attribute: true
attribute :persistdir, kind_of: String, regex: /.*/, default: nil
attribute :pluginconfpath, kind_of: String, regex: /.*/, default: nil
attribute :pluginpath, kind_of: String, regex: /.*/, default: nil
attribute :plugins, kind_of: [TrueClass, FalseClass], default: true
attribute :protected_multilib, kind_of: [TrueClass, FalseClass], default: nil
attribute :protected_packages, kind_of: String, regex: /.*/, default: nil
attribute :proxy, kind_of: String, regex: /.*/, default: nil
attribute :proxy_password, kind_of: String, regex: /.*/, default: nil
attribute :proxy_username, kind_of: String, regex: /.*/, default: nil
attribute :recent, kind_of: String, regex: /^\d+$/, default: nil
attribute :releasever, kind_of: String, regex: /.*/, default: nil
attribute :repo_gpgcheck, kind_of: [TrueClass, FalseClass], default: nil
attribute :reposdir, kind_of: String, regex: /.*/, default: nil
attribute :reset_nice, kind_of: [TrueClass, FalseClass], default: nil
attribute :rpmverbosity, kind_of: String, equal_to: %w(info critical emergency error warn debug), default: nil
attribute :showdupesfromrepos, kind_of: [TrueClass, FalseClass], default: nil
attribute :skip_broken, kind_of: [TrueClass, FalseClass], default: nil
attribute :ssl_check_cert_permissions, kind_of: [TrueClass, FalseClass], default: nil
attribute :sslcacert, kind_of: String, regex: /.*/, default: nil
attribute :sslclientcert, kind_of: String, regex: /.*/, default: nil
attribute :sslclientkey, kind_of: String, regex: /.*/, default: nil
attribute :sslverify, kind_of: [TrueClass, FalseClass], default: nil
attribute :syslog_device, kind_of: String, regex: /.*/, default: nil
attribute :syslog_facility, kind_of: String, regex: /.*/, default: nil
attribute :syslog_ident, kind_of: String, regex: /.*/, default: nil
attribute :throttle, kind_of: String, regex: [/\d+k/, /\d+M/, /\d+G/], default: nil
attribute :timeout, kind_of: String, regex: /^\d+$/, default: nil
attribute :tolerant, kind_of: [TrueClass, FalseClass], default: nil
attribute :tsflags, kind_of: String, regex: /.*/, default: nil
attribute :username, kind_of: String, regex: /.*/, default: nil
property :alwaysprompt, [TrueClass, FalseClass]
property :assumeyes, [TrueClass, FalseClass]
property :bandwidth, String, regex: /^\d+/
property :bugtracker_url, String, regex: /.*/
property :clean_requirements_on_remove, [TrueClass, FalseClass]
property :cachedir, String, regex: /.*/, default: '/var/cache/yum/$basearch/$releasever'
property :color, String, equal_to: %w(always never)
property :color_list_available_downgrade, String, regex: /.*/
property :color_list_available_install, String, regex: /.*/
property :color_list_available_reinstall, String, regex: /.*/
property :color_list_available_upgrade, String, regex: /.*/
property :color_list_installed_extra, String, regex: /.*/
property :color_list_installed_newer, String, regex: /.*/
property :color_list_installed_older, String, regex: /.*/
property :color_list_installed_reinstall, String, regex: /.*/
property :color_search_match, String, regex: /.*/
property :color_update_installed, String, regex: /.*/
property :color_update_local, String, regex: /.*/
property :color_update_remote, String, regex: /.*/
property :commands, String, regex: /.*/
property :debuglevel, String, regex: /^\d+$/, default: '2'
property :deltarpm, [TrueClass, FalseClass]
property :diskspacecheck, [TrueClass, FalseClass]
property :distroverpkg, String, regex: /.*/
property :enable_group_conditionals, [TrueClass, FalseClass]
property :errorlevel, String, regex: /^\d+$/
property :exactarch, [TrueClass, FalseClass], default: true
property :exclude, String, regex: /.*/
property :gpgcheck, [TrueClass, FalseClass], default: true
property :group_package_types, String, regex: /.*/
property :groupremove_leaf_only, [TrueClass, FalseClass]
property :history_list_view, String, equal_to: %w(users commands single-user-commands)
property :history_record, [TrueClass, FalseClass]
property :history_record_packages, String, regex: /.*/
property :http_caching, String, equal_to: %w(packages all none)
property :installonly_limit, String, regex: [/^\d+/, /keep/], default: '3'
property :installonlypkgs, String, regex: /.*/
property :installroot, String, regex: /.*/
property :keepalive, [TrueClass, FalseClass]
property :keepcache, [TrueClass, FalseClass], default: false
property :kernelpkgnames, String, regex: /.*/
property :localpkg_gpgcheck, [TrueClass, FalseClass]
property :logfile, String, regex: /.*/, default: '/var/log/yum.log'
property :max_retries, String, regex: /^\d+$/
property :mdpolicy, String, equal_to: %w(instant group:primary group:small group:main group:all)
property :metadata_expire, String, regex: [/^\d+$/, /^\d+[mhd]$/, /never/]
property :mirrorlist_expire, String, regex: /^\d+$/
property :multilib_policy, String, equal_to: %w(all best)
property :obsoletes, [TrueClass, FalseClass]
property :overwrite_groups, [TrueClass, FalseClass]
property :password, String, regex: /.*/
property :path, String, regex: /.*/, name_property: true
property :persistdir, String, regex: /.*/
property :pluginconfpath, String, regex: /.*/
property :pluginpath, String, regex: /.*/
property :plugins, [TrueClass, FalseClass], default: true
property :protected_multilib, [TrueClass, FalseClass]
property :protected_packages, String, regex: /.*/
property :proxy, String, regex: /.*/
property :proxy_password, String, regex: /.*/
property :proxy_username, String, regex: /.*/
property :recent, String, regex: /^\d+$/
property :releasever, String, regex: /.*/
property :repo_gpgcheck, [TrueClass, FalseClass]
property :reposdir, String, regex: /.*/
property :reset_nice, [TrueClass, FalseClass]
property :rpmverbosity, String, equal_to: %w(info critical emergency error warn debug)
property :showdupesfromrepos, [TrueClass, FalseClass]
property :skip_broken, [TrueClass, FalseClass]
property :ssl_check_cert_permissions, [TrueClass, FalseClass]
property :sslcacert, String, regex: /.*/
property :sslclientcert, String, regex: /.*/
property :sslclientkey, String, regex: /.*/
property :sslverify, [TrueClass, FalseClass]
property :syslog_device, String, regex: /.*/
property :syslog_facility, String, regex: /.*/
property :syslog_ident, String, regex: /.*/
property :throttle, String, regex: [/\d+k/, /\d+M/, /\d+G/]
property :timeout, String, regex: /^\d+$/
property :tolerant, [TrueClass, FalseClass]
property :tsflags, String, regex: /.*/
property :username, String, regex: /.*/
property :options, Hash
attribute :options, kind_of: Hash
action :create do
template new_resource.path do
source 'main.erb'
cookbook 'yum'
mode '0644'
variables(config: new_resource)
end
end
action :delete do
file new_resource.path do
action :delete
end
end

View File

@@ -1,71 +0,0 @@
#
# Cookbook Name:: yum
# Resource:: repository
#
# Author:: Sean OMeara <someara@chef.io>
# Copyright 2013, Chef
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
actions :create, :delete, :add, :remove, :makecache
default_action :create
# http://linux.die.net/man/5/yum.conf
attribute :baseurl, kind_of: String, regex: /.*/, default: nil
attribute :cost, kind_of: String, regex: /^\d+$/, default: nil
attribute :clean_headers, kind_of: [TrueClass, FalseClass], default: false # deprecated
attribute :clean_metadata, kind_of: [TrueClass, FalseClass], default: true
attribute :description, kind_of: String, regex: /.*/, default: 'Ye Ole Rpm Repo'
attribute :enabled, kind_of: [TrueClass, FalseClass], default: true
attribute :enablegroups, kind_of: [TrueClass, FalseClass], default: nil
attribute :exclude, kind_of: String, regex: /.*/, default: nil
attribute :failovermethod, kind_of: String, equal_to: %w(priority roundrobin), default: nil
attribute :fastestmirror_enabled, kind_of: [TrueClass, FalseClass], default: nil
attribute :gpgcheck, kind_of: [TrueClass, FalseClass], default: true
attribute :gpgkey, kind_of: [String, Array], regex: /.*/, default: nil
attribute :http_caching, kind_of: String, equal_to: %w(packages all none), default: nil
attribute :include_config, kind_of: String, regex: /.*/, default: nil
attribute :includepkgs, kind_of: String, regex: /.*/, default: nil
attribute :keepalive, kind_of: [TrueClass, FalseClass], default: nil
attribute :make_cache, kind_of: [TrueClass, FalseClass], default: true
attribute :max_retries, kind_of: [String, Integer], default: nil
attribute :metadata_expire, kind_of: String, regex: [/^\d+$/, /^\d+[mhd]$/, /never/], default: nil
attribute :mirrorexpire, kind_of: String, regex: /.*/, default: nil
attribute :mirrorlist, kind_of: String, regex: /.*/, default: nil
attribute :mirror_expire, kind_of: String, regex: [/^\d+$/, /^\d+[mhd]$/], default: nil
attribute :mirrorlist_expire, kind_of: String, regex: [/^\d+$/, /^\d+[mhd]$/], default: nil
attribute :mode, default: '0644'
attribute :priority, kind_of: String, regex: /^(\d?[0-9]|[0-9][0-9])$/, default: nil
attribute :proxy, kind_of: String, regex: /.*/, default: nil
attribute :proxy_username, kind_of: String, regex: /.*/, default: nil
attribute :proxy_password, kind_of: String, regex: /.*/, default: nil
attribute :username, kind_of: String, regex: /.*/, default: nil
attribute :password, kind_of: String, regex: /.*/, default: nil
attribute :repo_gpgcheck, kind_of: [TrueClass, FalseClass], default: nil
attribute :report_instanceid, kind_of: [TrueClass, FalseClass], default: nil
attribute :repositoryid, kind_of: String, regex: /.*/, name_attribute: true
attribute :sensitive, kind_of: [TrueClass, FalseClass], default: false
attribute :skip_if_unavailable, kind_of: [TrueClass, FalseClass], default: nil
attribute :source, kind_of: String, regex: /.*/, default: nil
attribute :sslcacert, kind_of: String, regex: /.*/, default: nil
attribute :sslclientcert, kind_of: String, regex: /.*/, default: nil
attribute :sslclientkey, kind_of: String, regex: /.*/, default: nil
attribute :sslverify, kind_of: [TrueClass, FalseClass], default: nil
attribute :timeout, kind_of: String, regex: /^\d+$/, default: nil
attribute :options, kind_of: Hash
alias_method :url, :baseurl
alias_method :keyurl, :gpgkey

View File

@@ -1,125 +0,0 @@
# This file was generated by Chef
# Do NOT modify this file by hand.
[<%= @config.repositoryid %>]
name=<%= @config.description %>
<% if @config.baseurl %>
baseurl=<%= @config.baseurl %>
<% end %>
<% if @config.cost %>
cost=<%= @config.cost %>
<% end %>
<% if @config.enabled %>
enabled=1
<% else %>
enabled=0
<% end %>
<% if @config.enablegroups %>
enablegroups=1
<% end %>
<% if @config.exclude %>
exclude=<%= @config.exclude %>
<% end %>
<% if @config.failovermethod %>
failovermethod=<%= @config.failovermethod %>
<% end %>
<% if @config.fastestmirror_enabled %>
fastestmirror_enabled=<%= @config.fastestmirror_enabled %>
<% end %>
<% if @config.gpgcheck %>
gpgcheck=1
<% else %>
gpgcheck=0
<% end %>
<% if @config.gpgkey %>
gpgkey=<%= case @config.gpgkey
when Array
@config.gpgkey.join("\n ")
else
@config.gpgkey
end %>
<% end -%>
<% if @config.http_caching %>
http_caching=<%= @config.http_caching %>
<% end %>
<% if @config.include_config %>
include=<%= @config.include_config %>
<% end %>
<% if @config.includepkgs %>
includepkgs=<%= @config.includepkgs %>
<% end %>
<% if @config.keepalive %>
keepalive=1
<% end %>
<% if @config.metadata_expire %>
metadata_expire=<%= @config.metadata_expire %>
<% end %>
<% if @config.mirrorlist %>
mirrorlist=<%= @config.mirrorlist %>
<% end %>
<% if @config.mirror_expire %>
mirror_expire=<%= @config.mirror_expire %>
<% end %>
<% if @config.mirrorlist_expire %>
mirrorlist_expire=<%= @config.mirrorlist_expire %>
<% end %>
<% if @config.priority %>
priority=<%= @config.priority %>
<% end %>
<% if @config.proxy %>
proxy=<%= @config.proxy %>
<% end %>
<% if @config.proxy_username %>
proxy_username=<%= @config.proxy_username %>
<% end %>
<% if @config.proxy_password %>
proxy_password=<%= @config.proxy_password %>
<% end %>
<% if @config.username %>
username=<%= @config.username %>
<% end %>
<% if @config.password %>
password=<%= @config.password %>
<% end %>
<% if @config.repo_gpgcheck %>
repo_gpgcheck=1
<% end %>
<% if @config.max_retries %>
retries=<%= @config.max_retries %>
<% end %>
<% if @config.report_instanceid %>
report_instanceid=<%= @config.report_instanceid %>
<% end %>
<% if @config.skip_if_unavailable %>
skip_if_unavailable=1
<% end %>
<% if @config.sslcacert %>
sslcacert=<%= @config.sslcacert %>
<% end %>
<% if @config.sslclientcert %>
sslclientcert=<%= @config.sslclientcert %>
<% end %>
<% if @config.sslclientkey %>
sslclientkey=<%= @config.sslclientkey %>
<% end %>
<% unless @config.sslverify.nil? %>
sslverify=<%= ( @config.sslverify ) ? 'true' : 'false' %>
<% end %>
<% if @config.timeout %>
timeout=<%= @config.timeout %>
<% end %>
<% if @config.options -%>
<% @config.options.each do |key, value| -%>
<%= key %>=<%=
case value
when Array
value.join("\n ")
when TrueClass
'1'
when FalseClass
'0'
else
value
end %>
<% end -%>
<% end -%>