Commit 3bd30160 authored by Tim Smith's avatar Tim Smith Committed by GitHub

Merge pull request #169 from chef-cookbooks/chef13

Remove yum_repository and convert globalconfig to custom resource
parents c594b60d 36557f65
driver:
name: dokken
chef_version: 12.1.0
chef_version: 12.14.89
privileged: true # because Docker and SystemD/Upstart
transport:
......
......@@ -2,6 +2,16 @@
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
......@@ -10,6 +20,7 @@ This file is used to list changes made in each version of the yum cookbook.
- Convert to Inspec
## 4.1.0 (2016-10-21)
- Purge yum cache before removing a repo not after
## 4.0.0 (2016-09-06)
......
......@@ -2,7 +2,7 @@
[![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)
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>
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
......@@ -13,87 +13,13 @@ The Yum cookbook exposes the `yum_globalconfig` and `yum_repository` resources t
### Chef
- Chef 12.1+
- 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 some internal company repo
yum_repository 'OurCo' do
description 'OurCo yum repository'
mirrorlist 'http://artifacts.ourco.org/mirrorlist?repo=ourco-6&arch=$basearch'
gpgkey 'http://artifacts.ourco.org/pub/yum/RPM-GPG-KEY-OURCO-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
......@@ -111,7 +37,7 @@ yum_globalconfig '/my/chroot/etc/yum.conf' do
end
```
#### Parameters
#### 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>
......@@ -124,10 +50,14 @@ end
- `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
......@@ -179,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.
......
......@@ -22,6 +22,7 @@ namespace :style do
t.options = {
fail_tags: ['any'],
progress: true,
exclude: 'spec',
}
end
rescue LoadError => e
......
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
......
......@@ -3,7 +3,7 @@ maintainer 'Chef Software, Inc.'
maintainer_email 'cookbooks@chef.io'
license 'Apache 2.0'
description 'Configures various yum components on Red Hat-like systems'
version '4.2.0'
version '5.0.0'
%w(amazon centos fedora oracle redhat scientific zlinux).each do |os|
supports os
......@@ -11,4 +11,4 @@ end
source_url 'https://github.com/chef-cookbooks/yum'
issues_url 'https://github.com/chef-cookbooks/yum/issues'
chef_version '>= 12.1' if respond_to?(:chef_version)
chef_version '>= 12.14'
#
# Cookbook:: yum
# Provider:: repository
#
# Author:: Sean OMeara <someara@chef.io>
# Copyright:: 2013-2016, 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.
# 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.
#
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
#
# Cookbook:: yum
# Provider:: repository
#
# Author:: Sean OMeara <someara@chef.io>
# Copyright:: 2013-2016, 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.
# 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.
#
use_inline_resources
def whyrun_supported?
true
end
action :add do
Chef::Log.warn('The :add method in yum_repository has been deprecated in favor of :create. Please update your cookbook to use the :create action')
action_create
end
action :remove do
Chef::Log.warn('The :remove method in yum_repository has been deprecated in favor of :delete. Repository deletion in Chef 12.14+ with :remove will fail')
action_delete
end
action :create do
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
# clean the repo cache first.
execute "yum clean all #{new_resource.repositoryid}" do
command "yum clean all --disablerepo=* --enablerepo=#{new_resource.repositoryid}"
only_if "yum repolist all | grep -P '^#{new_resource.repositoryid}([ \t]|$)'"
end
file "/etc/yum.repos.d/#{new_resource.repositoryid}.repo" do
action :delete
notifies :create, "ruby_block[yum-cache-reload-#{new_resource.repositoryid}]", :immediately
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
......@@ -3,7 +3,7 @@
# Resource:: repository
#
# Author:: Sean OMeara <someara@chef.io>
# 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.
......@@ -18,91 +18,102 @@
# limitations under the License.
#
actions :create, :delete
# http://linux.die.net/man/5/yum.conf
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
default_action :create
action :create do
template new_resource.path do
source 'main.erb'
cookbook 'yum'
mode '0644'
variables(config: new_resource)
end
end
# 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
attribute :options, kind_of: Hash
action :delete do
file new_resource.path do
action :delete
end
end
#
# Cookbook:: yum
# Resource:: repository
#
# Author:: Sean OMeara <someara@chef.io>
# Copyright:: 2013-2016, 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.
# 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, Array], 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