diff --git a/.gitignore b/.gitignore index 17d00283f63..d3ee296ebcb 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,9 @@ *.log *.log* nohup.out +.DS_Store + +# Vagrant stuff. +.vagrant +/vagrant/build +/vagrant/chef/tmp diff --git a/README.md b/README.md index 0b370ed60c9..dd1fb23b9b7 100644 --- a/README.md +++ b/README.md @@ -9,5 +9,3 @@ http://jamesagnew.github.io/hapi-fhir/ A demonstration of this project is available here: http://fhirtest.uhn.ca/ - - diff --git a/hapi-fhir-base/examples/src/main/java/example/ClientExamples.java b/hapi-fhir-base/examples/src/main/java/example/ClientExamples.java index 0c3c3be7689..cd22c69c41f 100644 --- a/hapi-fhir-base/examples/src/main/java/example/ClientExamples.java +++ b/hapi-fhir-base/examples/src/main/java/example/ClientExamples.java @@ -6,6 +6,7 @@ import ca.uhn.fhir.rest.client.IRestfulClientFactory; import ca.uhn.fhir.rest.client.api.IBasicClient; import ca.uhn.fhir.rest.client.interceptor.BasicAuthInterceptor; import ca.uhn.fhir.rest.client.interceptor.BearerTokenAuthInterceptor; +import ca.uhn.fhir.rest.client.interceptor.CookieInterceptor; import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; import ca.uhn.fhir.rest.server.EncodingEnum; @@ -46,6 +47,27 @@ public class ClientExamples { // END SNIPPET: security } + @SuppressWarnings("unused") + public void createCookie() { + // START SNIPPET: cookie + // Create a context and get the client factory so it can be configured + FhirContext ctx = new FhirContext(); + IRestfulClientFactory clientFactory = ctx.getRestfulClientFactory(); + + // Create a cookie interceptor. This cookie will have the name "mycookie" and + // the value "Chips Ahoy" + CookieInterceptor interceptor = new CookieInterceptor("mycookie=Chips Ahoy"); + + // Register the interceptor with your client (either style) + IPatientClient annotationClient = ctx.newRestfulClient(IPatientClient.class, "http://localhost:9999/fhir"); + annotationClient.registerInterceptor(interceptor); + + IGenericClient genericClient = ctx.newRestfulGenericClient("http://localhost:9999/fhir"); + annotationClient.registerInterceptor(interceptor); + // END SNIPPET: cookie + } + + @SuppressWarnings("unused") public void createSecurityBearer() { // START SNIPPET: securityBearer diff --git a/hapi-fhir-base/examples/src/main/java/example/ValidatorExamples.java b/hapi-fhir-base/examples/src/main/java/example/ValidatorExamples.java index d11feca8dda..c2460d85004 100644 --- a/hapi-fhir-base/examples/src/main/java/example/ValidatorExamples.java +++ b/hapi-fhir-base/examples/src/main/java/example/ValidatorExamples.java @@ -1,9 +1,7 @@ package example; import java.io.File; -import java.io.FileNotFoundException; import java.io.FileReader; -import java.io.IOException; import org.apache.commons.io.IOUtils; import org.apache.commons.io.filefilter.WildcardFileFilter; @@ -12,51 +10,50 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.model.api.IResource; import ca.uhn.fhir.model.dstu.resource.Patient; import ca.uhn.fhir.model.dstu.valueset.ContactSystemEnum; -import ca.uhn.fhir.parser.DataFormatException; import ca.uhn.fhir.validation.FhirValidator; -import ca.uhn.fhir.validation.ValidationFailureException; +import ca.uhn.fhir.validation.ValidationResult; public class ValidatorExamples { public void validateResource() { - //START SNIPPET: basicValidation + // START SNIPPET: basicValidation // As always, you need a context FhirContext ctx = new FhirContext(); - + // Create and populate a new patient object Patient p = new Patient(); p.addName().addFamily("Smith").addGiven("John").addGiven("Q"); p.addIdentifier("urn:foo:identifiers", "12345"); p.addTelecom().setSystem(ContactSystemEnum.PHONE).setValue("416 123-4567"); - + // Request a validator and apply it FhirValidator val = ctx.newValidator(); - try { + + ValidationResult result = val.validateWithResult(p); + if (result.isSuccessful()) { - val.validate(p); System.out.println("Validation passed"); - } catch (ValidationFailureException e) { + } else { // We failed validation! - + System.out.println("Validation failed"); - - // The ValidationFailureException which gets thrown by the validator - // will contain an OperationOutcome resource describing the failure - String results = ctx.newXmlParser().setPrettyPrint(true).encodeResourceToString(e.getOperationOutcome()); + + // The result contains an OperationOutcome outlining the failures + String results = ctx.newXmlParser().setPrettyPrint(true).encodeResourceToString(result.getOperationOutcome()); System.out.println(results); } - //END SNIPPET: basicValidation - - } - - public static void main(String[] args) throws DataFormatException, IOException { - validateFiles(); - + // END SNIPPET: basicValidation + } - private static void validateFiles() throws IOException, FileNotFoundException { - //START SNIPPET: validateFiles + public static void main(String[] args) throws Exception { + validateFiles(); + + } + + private static void validateFiles() throws Exception { + // START SNIPPET: validateFiles FhirContext ctx = new FhirContext(); // Create a validator and configure it @@ -67,19 +64,23 @@ public class ValidatorExamples { // Get a list of files in a given directory String[] fileList = new File("/home/some/dir").list(new WildcardFileFilter("*.txt")); for (String nextFile : fileList) { - + // For each file, load the contents into a string String nextFileContents = IOUtils.toString(new FileReader(nextFile)); - + // Parse that string (this example assumes JSON encoding) IResource resource = ctx.newJsonParser().parseResource(nextFileContents); + + // Apply the validation. This will throw an exception on the first + // validation failure + ValidationResult result = validator.validateWithResult(resource); + if (result.isSuccessful() == false) { + throw new Exception("We failed!"); + } - // Apply the validation. This will throw an exception on the first validation failure - validator.validate(resource); } - - // If we make it here with no exception, all the files validated! - //END SNIPPET: validateFiles + + // END SNIPPET: validateFiles } } diff --git a/hapi-fhir-base/src/changes/changes.xml b/hapi-fhir-base/src/changes/changes.xml index 7dfd74859e7..7ce8838e33a 100644 --- a/hapi-fhir-base/src/changes/changes.xml +++ b/hapi-fhir-base/src/changes/changes.xml @@ -109,6 +109,21 @@ top-level resources in the returned bundle for search operations. Thanks to Bill de Beaubien for reporting! + + Add a + Vagrant]]> + based environment (basically a fully built, self contained development environment) for + trying out the HAPI server modules. Thanks to Preston Lee for the pull request, and for + offering to maintain this! + + + Change validation API so that it uses a return type instead of exceptions to communicate + validation failures. Thanks to Joe Athman for the pull request! + + + Add a client interceptor which adds an HTTP cookie to each client request. Thanks to + Petro Mykhailysyn for the pull request! + + + + + + + + + + + + <% if node['tomcat']['base_version'].to_i < 7 -%> + + + <% end -%> + + + + + + + + + + + + + + + <% if @port -%> + + + proxyPort="<%= @proxy_port %>" + <% end -%> + <% if @max_threads -%> + maxThreads="<%= @max_threads %>" + <% end -%> + <% if @ssl_port -%> + redirectPort="<%= @ssl_port %>" + <% end -%> + /> + <% end -%> + + + <% if @ssl_port -%> + + + proxyPort="<%= @ssl_proxy_port %>" + <% end -%> + keystoreFile="<%= @config_dir %>/<%= @keystore_file %>" + keystorePass="<%= node['tomcat']['keystore_password'] %>" + keystoreType="<%= @keystore_type %>" + truststorePass="<%= node['tomcat']['keystore_password'] %>" + maxThreads="<%= @ssl_max_threads %>" scheme="https" secure="true" + clientAuth="false" sslProtocol="TLS" /> + <% end -%> + + <% if @ajp_port -%> + + + <% end -%> + + + + + jvmRoute="<%= node['tomcat']['jvm_route'] %>"<% end %>> + + + + + + + + + + + + + xmlValidation="false" xmlNamespaceAware="false" + <% end -%> + > + + + + + + + + + + + diff --git a/vagrant/chef/cookbooks/tomcat/templates/default/setenv.sh.erb b/vagrant/chef/cookbooks/tomcat/templates/default/setenv.sh.erb new file mode 100644 index 00000000000..d4b4b49fdca --- /dev/null +++ b/vagrant/chef/cookbooks/tomcat/templates/default/setenv.sh.erb @@ -0,0 +1,13 @@ +#!/usr/bin/env sh +# +# setenv.sh +# +# Generated by Chef for <%= node['fqdn'] %> +# Local modifications will be overwritten. +# +export JAVA_HOME='<%= node["java"]["java_home"] %>' +export CATALINA_HOME='<%= node["tomcat"]["home"] %>' +export CATALINA_BASE='<%= node["tomcat"]["base"] %>' +export JAVA_OPTS='<%= node["tomcat"]["java_options"] %>' +export CATALINA_OPTS='<%= node["tomcat"]["catalina_options"] %>' +export CATALINA_PID='<%= node["tomcat"]["log_dir"] %>/catalina.pid' diff --git a/vagrant/chef/cookbooks/tomcat/templates/default/sysconfig_tomcat6.erb b/vagrant/chef/cookbooks/tomcat/templates/default/sysconfig_tomcat6.erb new file mode 100644 index 00000000000..82a50583d82 --- /dev/null +++ b/vagrant/chef/cookbooks/tomcat/templates/default/sysconfig_tomcat6.erb @@ -0,0 +1,65 @@ +# +# Dynamically generated by Chef on <%= node["fqdn"] %> +# +# Local modifications will be overwritten by Chef. +# + +# Service-specific configuration file for tomcat6. This will be sourced by +# the SysV init script after the global configuration file +# /etc/tomcat6/tomcat6.conf, thus allowing values to be overridden in +# a per-service manner. +# +# NEVER change the init script itself. To change values for all services make +# your changes in /etc/tomcat6/tomcat6.conf +# +# To change values for a specific service make your edits here. +# To create a new service create a link from /etc/init.d/ to +# /etc/init.d/tomcat6 (do not copy the init script) and make a copy of the +# /etc/sysconfig/tomcat6 file to /etc/sysconfig/ and change +# the property values so the two services won't conflict. Register the new +# service in the system as usual (see chkconfig and similars). +# + +# Where your java installation lives +JAVA_HOME=<%= node["java"]["java_home"] %> + +# Where your tomcat installation lives +CATALINA_BASE="<%= @base %>" +CATALINA_HOME="<%= @home %>" +JASPER_HOME="<%= @home %>" +CATALINA_TMPDIR="<%= @tmp_dir %>" + +# You can pass some parameters to java here if you wish to +JAVA_OPTS="<%= @java_options %>" + +# Use JAVA_OPTS to set java.library.path for libtcnative.so +#JAVA_OPTS="-Djava.library.path=/usr/lib64" + +# What user should run tomcat +TOMCAT_USER="<%= @user %>" + +# You can change your tomcat locale here +#LANG="en_US" + +# Run tomcat under the Java Security Manager +SECURITY_MANAGER="<%= @use_security_manager %>" + +# Time to wait in seconds, before killing process +#SHUTDOWN_WAIT="30" + +# Whether to annoy the user with "attempting to shut down" messages or not +#SHUTDOWN_VERBOSE="false" + +# Set the TOMCAT_PID location +#CATALINA_PID="/var/run/tomcat6.pid" + +# JVM parameters passed only for start and run commands +CATALINA_OPTS="<%= @catalina_options %>" + +# Endorse .jar files in this directory +JAVA_ENDORSED_DIRS="<%= @endorsed_dir %>" + +# If you wish to further customize your tomcat environment, +# put your own definitions here +# (i.e. LD_LIBRARY_PATH for some jdbc drivers) + diff --git a/vagrant/chef/cookbooks/tomcat/templates/default/tomcat-users.xml.erb b/vagrant/chef/cookbooks/tomcat/templates/default/tomcat-users.xml.erb new file mode 100644 index 00000000000..831b2c16199 --- /dev/null +++ b/vagrant/chef/cookbooks/tomcat/templates/default/tomcat-users.xml.erb @@ -0,0 +1,25 @@ + + + +<% @roles.each do |role| -%> + +<% end -%> +<% @users.each do |user| -%> + +<% end -%> + diff --git a/vagrant/chef/cookbooks/yum-mysql-community/CHANGELOG.md b/vagrant/chef/cookbooks/yum-mysql-community/CHANGELOG.md new file mode 100644 index 00000000000..65b182737f9 --- /dev/null +++ b/vagrant/chef/cookbooks/yum-mysql-community/CHANGELOG.md @@ -0,0 +1,71 @@ +yum-mysql-community Cookbook CHANGELOG +====================== +This file is used to list changes made in each version of the yum-centos cookbook. + +v0.1.10 (2014-07-21) +------------------- +- Adding mysql-5.7 and centos 7 support + +v0.1.8 (2014-06-18) +------------------- +- Updating to support real RHEL + + +v0.1.6 (2014-06-16) +------------------- +Fixing typo in mysql55-community attributes + + +v0.1.4 (2014-06-13) +------------------- +- updating url to keys in cookbook attributes + + +v0.1.2 (2014-06-11) +------------------- +#1 - Move files/mysql_pubkey.asc to files/default/mysql_pubkey.asc + + +v0.1.0 (2014-04-30) +------------------- +Initial release + + +v0.3.6 (2014-04-09) +------------------- +- [COOK-4509] add RHEL7 support to yum-mysql-community cookbook + + +v0.3.4 (2014-02-19) +------------------- +COOK-4353 - Fixing typo in readme + + +v0.3.2 (2014-02-13) +------------------- +Updating README to explain the 'managed' parameter + + +v0.3.0 (2014-02-12) +------------------- +[COOK-4292] - Do not manage secondary repos by default + + +v0.2.0 +------ +Adding Amazon Linux support + + +v0.1.6 +------ +Fixing up attribute values for EL6 + + +v0.1.4 +------ +Adding CHANGELOG.md + + +v0.1.0 +------ +initial release diff --git a/vagrant/chef/cookbooks/yum-mysql-community/README.md b/vagrant/chef/cookbooks/yum-mysql-community/README.md new file mode 100644 index 00000000000..fe49b10711a --- /dev/null +++ b/vagrant/chef/cookbooks/yum-mysql-community/README.md @@ -0,0 +1,137 @@ +yum-mysql-community Cookbook +============ + +The yum-mysql-community cookbook takes over management of the default +repositoryids shipped with epel-release. It allows attribute +manipulation of `mysql-connectors-community`, `mysql56-community`, and +`mysql57-community-dmr`. + +Requirements +------------ +* Chef 11 or higher +* yum cookbook version 3.0.0 or higher + +Attributes +---------- +The following attributes are set by default + +``` ruby +default['yum']['mysql-connectors-community']['repositoryid'] = 'mysql-connectors-community' +default['yum']['mysql-connectors-community']['description'] = 'MySQL Connectors Community' +default['yum']['mysql-connectors-community']['baseurl'] = 'http://repo.mysql.com/yum/mysql-connectors-community/el/$releasever/$basearch/' +default['yum']['mysql-connectors-community']['gpgkey'] = 'https://raw.githubusercontent.com/rs-services/equinix-public/master/cookbooks/db_mysql/files/centos/mysql_pubkey.asc' +default['yum']['mysql-connectors-community']['failovermethod'] = 'priority' +default['yum']['mysql-connectors-community']['gpgcheck'] = true +default['yum']['mysql-connectors-community']['enabled'] = true +``` + +``` ruby +default['yum']['mysql56-community']['repositoryid'] = 'mysql56-community' +default['yum']['mysql56-community']['description'] = 'MySQL 5.6 Community Server' +default['yum']['mysql56-community']['baseurl'] = 'http://repo.mysql.com/yum/mysql56-community/el/$releasever/$basearch/' +default['yum']['mysql56-community']['gpgkey'] = 'https://raw.githubusercontent.com/rs-services/equinix-public/master/cookbooks/db_mysql/files/centos/mysql_pubkey.asc' +default['yum']['mysql56-community']['failovermethod'] = 'priority' +default['yum']['mysql56-community']['gpgcheck'] = true +default['yum']['mysql56-community']['enabled'] = true +``` + +``` ruby +default['yum']['mysql57-community-dmr']['repositoryid'] = 'mysql57-community-dmr' +default['yum']['mysql57-community-dmr']['description'] = 'MySQL 5.7 Community Server Development Milestone Release' +default['yum']['mysql57-community-dmr']['baseurl'] = 'http://repo.mysql.com/yum/mysql56-community/el/$releasever/$basearch/' +default['yum']['mysql57-community-dmr']['gpgkey'] = 'https://raw.githubusercontent.com/rs-services/equinix-public/master/cookbooks/db_mysql/files/centos/mysql_pubkey.asc' +default['yum']['mysql57-community-dmr']['failovermethod'] = 'priority' +default['yum']['mysql57-community-dmr']['gpgcheck'] = true +default['yum']['mysql57-community-dmr']['enabled'] = true +``` + +Recipes +------- +* mysql55 - Sets up the mysql56-community repository on supported + platforms + +```ruby + yum_repository 'mysql55-community' do + mirrorlist 'http://repo.mysql.com/yum/mysql55-community/el/$releasever/$basearch/' + description '' + enabled true + gpgcheck true + end +``` + +* mysql56 - Sets up the mysql56-community repository on supported + platforms + +```ruby + yum_repository 'mysql56-community' do + mirrorlist 'http://repo.mysql.com/yum/mysql56-community/el/$releasever/$basearch/' + description '' + enabled true + gpgcheck true + end +``` + + +* connectors - Sets up the mysql-connectors-community repository on supported + platforms + + +Usage Example +------------- +To disable the epel repository through a Role or Environment definition + +``` +default_attributes( + :yum => { + :mysql57-community-dmr => { + :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 epel-testing repository with a +wrapper cookbook, place the following in a recipe: + +``` +node.default['yum']['mysql57-community-dmr']['enabled'] = true +node.default['yum']['mysql57-community-dmr']['managed'] = true +include_recipe 'mysql57-community-dmr' +``` + +More Examples +------------- +Point the mysql56-community repositories at an internally hosted server. + +``` +node.default['yum']['mysql56-community']['enabled'] = true +node.default['yum']['mysql56-community']['mirrorlist'] = nil +node.default['yum']['mysql56-community']['baseurl'] = 'https://internal.example.com/mysql/mysql56-community/' +node.default['yum']['mysql56-community']['sslverify'] = false + +include_recipe 'mysql56-community' +``` + +License & Authors +----------------- +- Author:: Sean OMeara () + +```text +Copyright:: 2011-2014, 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. +``` diff --git a/vagrant/chef/cookbooks/yum-mysql-community/attributes/mysql-connectors-community.rb b/vagrant/chef/cookbooks/yum-mysql-community/attributes/mysql-connectors-community.rb new file mode 100644 index 00000000000..76ebb776e31 --- /dev/null +++ b/vagrant/chef/cookbooks/yum-mysql-community/attributes/mysql-connectors-community.rb @@ -0,0 +1,33 @@ +default['yum']['mysql-connectors-community']['repositoryid'] = 'mysql-connectors-community' +default['yum']['mysql-connectors-community']['gpgkey'] = 'https://raw.githubusercontent.com/someara/yum-mysql-community/master/files/default/mysql_pubkey.asc' +default['yum']['mysql-connectors-community']['description'] = 'MySQL Connectors Community' +default['yum']['mysql-connectors-community']['failovermethod'] = 'priority' +default['yum']['mysql-connectors-community']['gpgcheck'] = true +default['yum']['mysql-connectors-community']['enabled'] = true + +case node['platform_family'] +when 'rhel' + case node['platform'] + when 'amazon' + case node['platform_version'].to_i + when 2013 + default['yum']['mysql-connectors-community']['baseurl'] = 'http://repo.mysql.com/yum/mysql-connectors-community/el/6/$basearch/' + when 2014 + default['yum']['mysql-connectors-community']['baseurl'] = 'http://repo.mysql.com/yum/mysql-connectors-community/el/6/$basearch/' + end + when 'redhat' + case node['platform_version'].to_i + when 5 + # Real Redhat identifies $releasever as 5Server and 6Server + default['yum']['mysql-connectors-community']['baseurl'] = 'http://repo.mysql.com/yum/mysql-connectors-community/el/5/$basearch/' + when 6 + default['yum']['mysql-connectors-community']['baseurl'] = 'http://repo.mysql.com/yum/mysql-connectors-community/el/6/$basearch/' + when 7 + default['yum']['mysql-connectors-community']['baseurl'] = 'http://repo.mysql.com/yum/mysql-connectors-community/el/7/$basearch/' + end + else # other rhel + default['yum']['mysql-connectors-community']['baseurl'] = 'http://repo.mysql.com/yum/mysql-connectors-community/el/$releasever/$basearch/' + end +when 'fedora' + default['yum']['mysql-connectors-community']['baseurl'] = 'http://repo.mysql.com/yum/mysql-connectors-community/fc/$releasever/$basearch/' +end diff --git a/vagrant/chef/cookbooks/yum-mysql-community/attributes/mysql55-community.rb b/vagrant/chef/cookbooks/yum-mysql-community/attributes/mysql55-community.rb new file mode 100644 index 00000000000..ba84d30f73b --- /dev/null +++ b/vagrant/chef/cookbooks/yum-mysql-community/attributes/mysql55-community.rb @@ -0,0 +1,29 @@ +default['yum']['mysql55-community']['repositoryid'] = 'mysql55-community' +default['yum']['mysql55-community']['gpgkey'] = 'https://raw.githubusercontent.com/someara/yum-mysql-community/master/files/default/mysql_pubkey.asc' +default['yum']['mysql55-community']['description'] = 'MySQL 5.5 Community Server' +default['yum']['mysql55-community']['failovermethod'] = 'priority' +default['yum']['mysql55-community']['gpgcheck'] = true +default['yum']['mysql55-community']['enabled'] = true + +case node['platform_family'] +when 'rhel' + case node['platform'] + when 'amazon' + case node['platform_version'].to_i + when 2013 + default['yum']['mysql55-community']['baseurl'] = 'http://repo.mysql.com/yum/mysql-5.5-community/el/6/$basearch/' + when 2014 + default['yum']['mysql55-community']['baseurl'] = 'http://repo.mysql.com/yum/mysql-5.5-community/el/6/$basearch/' + end + when 'redhat' + case node['platform_version'].to_i + when 5 + # Real Redhat identifies $releasever as 5Server and 6Server + default['yum']['mysql55-community']['baseurl'] = 'http://repo.mysql.com/yum/mysql-5.5-community/el/5/$basearch/' + when 6 + default['yum']['mysql55-community']['baseurl'] = 'http://repo.mysql.com/yum/mysql-5.5-community/el/6/$basearch/' + end + else # other rhel. only 6 and 7 for now + default['yum']['mysql55-community']['baseurl'] = 'http://repo.mysql.com/yum/mysql-5.5-community/el/$releasever/$basearch/' + end +end diff --git a/vagrant/chef/cookbooks/yum-mysql-community/attributes/mysql56-community.rb b/vagrant/chef/cookbooks/yum-mysql-community/attributes/mysql56-community.rb new file mode 100644 index 00000000000..363628aa8fe --- /dev/null +++ b/vagrant/chef/cookbooks/yum-mysql-community/attributes/mysql56-community.rb @@ -0,0 +1,31 @@ +default['yum']['mysql56-community']['repositoryid'] = 'mysql56-community' +default['yum']['mysql56-community']['gpgkey'] = 'https://raw.githubusercontent.com/someara/yum-mysql-community/master/files/default/mysql_pubkey.asc' +default['yum']['mysql56-community']['description'] = 'MySQL 5.6 Community Server' +default['yum']['mysql56-community']['failovermethod'] = 'priority' +default['yum']['mysql56-community']['gpgcheck'] = true +default['yum']['mysql56-community']['enabled'] = true + +case node['platform_family'] +when 'rhel' + case node['platform'] + when 'amazon' + case node['platform_version'].to_i + when 2013 + default['yum']['mysql56-community']['baseurl'] = 'http://repo.mysql.com/yum/mysql-5.6-community/el/6/$basearch/' + when 2014 + default['yum']['mysql56-community']['baseurl'] = 'http://repo.mysql.com/yum/mysql-5.6-community/el/6/$basearch/' + end + when 'redhat' + case node['platform_version'].to_i + when 5 + # Real Redhat identifies $releasever as 5Server and 6Server + default['yum']['mysql56-community']['baseurl'] = 'http://repo.mysql.com/yum/mysql-5.6-community/el/5/$basearch/' + when 6 + default['yum']['mysql56-community']['baseurl'] = 'http://repo.mysql.com/yum/mysql-5.6-community/el/6/$basearch/' + end + else # other rhel + default['yum']['mysql56-community']['baseurl'] = 'http://repo.mysql.com/yum/mysql-5.6-community/el/$releasever/$basearch/' + end +when 'fedora' + default['yum']['mysql56-community']['baseurl'] = 'http://repo.mysql.com/yum/mysql-5.6-community/fc/$releasever/$basearch/' +end diff --git a/vagrant/chef/cookbooks/yum-mysql-community/attributes/mysql57-community.rb b/vagrant/chef/cookbooks/yum-mysql-community/attributes/mysql57-community.rb new file mode 100644 index 00000000000..08bd16c2351 --- /dev/null +++ b/vagrant/chef/cookbooks/yum-mysql-community/attributes/mysql57-community.rb @@ -0,0 +1,33 @@ +default['yum']['mysql57-community']['repositoryid'] = 'mysql57-community' +default['yum']['mysql57-community']['gpgkey'] = 'https://raw.githubusercontent.com/someara/yum-mysql-community/master/files/default/mysql_pubkey.asc' +default['yum']['mysql57-community']['description'] = 'MySQL 5.7 Community Server' +default['yum']['mysql57-community']['failovermethod'] = 'priority' +default['yum']['mysql57-community']['gpgcheck'] = true +default['yum']['mysql57-community']['enabled'] = true + +case node['platform_family'] +when 'rhel' + case node['platform'] + when 'amazon' + case node['platform_version'].to_i + when 2013 + default['yum']['mysql57-community']['baseurl'] = 'http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/' + when 2014 + default['yum']['mysql57-community']['baseurl'] = 'http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/' + end + when 'redhat' + case node['platform_version'].to_i + when 5 + # Real Redhat identifies $releasever as 5Server and 6Server + default['yum']['mysql57-community']['baseurl'] = 'http://repo.mysql.com/yum/mysql-5.7-community/el/5/$basearch/' + when 6 + default['yum']['mysql57-community']['baseurl'] = 'http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/' + when 7 + default['yum']['mysql57-community']['baseurl'] = 'http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/' + end + else # other rhel + default['yum']['mysql57-community']['baseurl'] = 'http://repo.mysql.com/yum/mysql-5.7-community/el/$releasever/$basearch/' + end +when 'fedora' + default['yum']['mysql57-community']['baseurl'] = 'http://repo.mysql.com/yum/mysql-5.7-community/fc/$releasever/$basearch/' +end diff --git a/vagrant/chef/cookbooks/yum-mysql-community/files/default/mysql_pubkey.asc b/vagrant/chef/cookbooks/yum-mysql-community/files/default/mysql_pubkey.asc new file mode 100644 index 00000000000..8009b882de7 --- /dev/null +++ b/vagrant/chef/cookbooks/yum-mysql-community/files/default/mysql_pubkey.asc @@ -0,0 +1,33 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.5 (GNU/Linux) + +mQGiBD4+owwRBAC14GIfUfCyEDSIePvEW3SAFUdJBtoQHH/nJKZyQT7h9bPlUWC3 +RODjQReyCITRrdwyrKUGku2FmeVGwn2u2WmDMNABLnpprWPkBdCk96+OmSLN9brZ +fw2vOUgCmYv2hW0hyDHuvYlQA/BThQoADgj8AW6/0Lo7V1W9/8VuHP0gQwCgvzV3 +BqOxRznNCRCRxAuAuVztHRcEAJooQK1+iSiunZMYD1WufeXfshc57S/+yeJkegNW +hxwR9pRWVArNYJdDRT+rf2RUe3vpquKNQU/hnEIUHJRQqYHo8gTxvxXNQc7fJYLV +K2HtkrPbP72vwsEKMYhhr0eKCbtLGfls9krjJ6sBgACyP/Vb7hiPwxh6rDZ7ITnE +kYpXBACmWpP8NJTkamEnPCia2ZoOHODANwpUkP43I7jsDmgtobZX9qnrAXw+uNDI +QJEXM6FSbi0LLtZciNlYsafwAPEOMDKpMqAK6IyisNtPvaLd8lH0bPAnWqcyefep +rv0sxxqUEMcM3o7wwgfN83POkDasDbs3pjwPhxvhz6//62zQJ7Q7TXlTUUwgUGFj +a2FnZSBzaWduaW5nIGtleSAod3d3Lm15c3FsLmNvbSkgPGJ1aWxkQG15c3FsLmNv +bT6IXQQTEQIAHQULBwoDBAMVAwIDFgIBAheABQJLcC5lBQkQ8/JZAAoJEIxxjTtQ +cuH1oD4AoIcOQ4EoGsZvy06D0Ei5vcsWEy8dAJ4g46i3WEcdSWxMhcBSsPz65sh5 +lohMBBMRAgAMBQI+PqPRBYMJZgC7AAoJEElQ4SqycpHyJOEAn1mxHijft00bKXvu +cSo/pECUmppiAJ41M9MRVj5VcdH/KN/KjRtW6tHFPYhMBBMRAgAMBQI+QoIDBYMJ +YiKJAAoJELb1zU3GuiQ/lpEAoIhpp6BozKI8p6eaabzF5MlJH58pAKCu/ROofK8J +Eg2aLos+5zEYrB/LsrkCDQQ+PqMdEAgA7+GJfxbMdY4wslPnjH9rF4N2qfWsEN/l +xaZoJYc3a6M02WCnHl6ahT2/tBK2w1QI4YFteR47gCvtgb6O1JHffOo2HfLmRDRi +Rjd1DTCHqeyX7CHhcghj/dNRlW2Z0l5QFEcmV9U0Vhp3aFfWC4Ujfs3LU+hkAWzE +7zaD5cH9J7yv/6xuZVw411x0h4UqsTcWMu0iM1BzELqX1DY7LwoPEb/O9Rkbf4fm +Le11EzIaCa4PqARXQZc4dhSinMt6K3X4BrRsKTfozBu74F47D8Ilbf5vSYHbuE5p +/1oIDznkg/p8kW+3FxuWrycciqFTcNz215yyX39LXFnlLzKUb/F5GwADBQf+Lwqq +a8CGrRfsOAJxim63CHfty5mUc5rUSnTslGYEIOCR1BeQauyPZbPDsDD9MZ1ZaSaf +anFvwFG6Llx9xkU7tzq+vKLoWkm4u5xf3vn55VjnSd1aQ9eQnUcXiL4cnBGoTbOW +I39EcyzgslzBdC++MPjcQTcA7p6JUVsP6oAB3FQWg54tuUo0Ec8bsM8b3Ev42Lmu +QT5NdKHGwHsXTPtl0klk4bQk4OajHsiy1BMahpT27jWjJlMiJc+IWJ0mghkKHt92 +6s/ymfdf5HkdQ1cyvsz5tryVI3Fx78XeSYfQvuuwqp2H139pXGEkg0n6KdUOetdZ +Whe70YGNPw1yjWJT1IhMBBgRAgAMBQI+PqMdBQkJZgGAAAoJEIxxjTtQcuH17p4A +n3r1QpVC9yhnW2cSAjq+kr72GX0eAJ4295kl6NxYEuFApmr1+0uUq/SlsQ== +=Mski +-----END PGP PUBLIC KEY BLOCK----- diff --git a/vagrant/chef/cookbooks/yum-mysql-community/metadata.json b/vagrant/chef/cookbooks/yum-mysql-community/metadata.json new file mode 100644 index 00000000000..9706316d544 --- /dev/null +++ b/vagrant/chef/cookbooks/yum-mysql-community/metadata.json @@ -0,0 +1,30 @@ +{ + "name": "yum-mysql-community", + "version": "0.1.10", + "description": "Installs/Configures yum-mysql-community", + "long_description": "", + "maintainer": "Chef Software, Inc", + "maintainer_email": "Sean OMeara ", + "license": "Apache 2.0", + "platforms": { + }, + "dependencies": { + "yum": ">= 3.0" + }, + "recommendations": { + }, + "suggestions": { + }, + "conflicting": { + }, + "providing": { + }, + "replacing": { + }, + "attributes": { + }, + "groupings": { + }, + "recipes": { + } +} \ No newline at end of file diff --git a/vagrant/chef/cookbooks/yum-mysql-community/metadata.rb b/vagrant/chef/cookbooks/yum-mysql-community/metadata.rb new file mode 100644 index 00000000000..3f07ca78399 --- /dev/null +++ b/vagrant/chef/cookbooks/yum-mysql-community/metadata.rb @@ -0,0 +1,8 @@ +name 'yum-mysql-community' +maintainer 'Chef Software, Inc' +maintainer_email 'Sean OMeara ' +license 'Apache 2.0' +description 'Installs/Configures yum-mysql-community' +version '0.1.10' + +depends 'yum', '>= 3.0' diff --git a/vagrant/chef/cookbooks/yum-mysql-community/recipes/connectors.rb b/vagrant/chef/cookbooks/yum-mysql-community/recipes/connectors.rb new file mode 100644 index 00000000000..830a85234a4 --- /dev/null +++ b/vagrant/chef/cookbooks/yum-mysql-community/recipes/connectors.rb @@ -0,0 +1,48 @@ +# +# Author:: Sean OMeara () +# Recipe:: yum-mysql-community::connectors +# +# Copyright 2014, 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. + +yum_repository 'mysql-connectors-community' do + description node['yum']['mysql-connectors-community']['description'] + baseurl node['yum']['mysql-connectors-community']['baseurl'] + mirrorlist node['yum']['mysql-connectors-community']['mirrorlist'] + gpgcheck node['yum']['mysql-connectors-community']['gpgcheck'] + gpgkey node['yum']['mysql-connectors-community']['gpgkey'] + enabled node['yum']['mysql-connectors-community']['enabled'] + cost node['yum']['mysql-connectors-community']['cost'] + exclude node['yum']['mysql-connectors-community']['exclude'] + enablegroups node['yum']['mysql-connectors-community']['enablegroups'] + failovermethod node['yum']['mysql-connectors-community']['failovermethod'] + http_caching node['yum']['mysql-connectors-community']['http_caching'] + include_config node['yum']['mysql-connectors-community']['include_config'] + includepkgs node['yum']['mysql-connectors-community']['includepkgs'] + keepalive node['yum']['mysql-connectors-community']['keepalive'] + max_retries node['yum']['mysql-connectors-community']['max_retries'] + metadata_expire node['yum']['mysql-connectors-community']['metadata_expire'] + mirror_expire node['yum']['mysql-connectors-community']['mirror_expire'] + priority node['yum']['mysql-connectors-community']['priority'] + proxy node['yum']['mysql-connectors-community']['proxy'] + proxy_username node['yum']['mysql-connectors-community']['proxy_username'] + proxy_password node['yum']['mysql-connectors-community']['proxy_password'] + repositoryid node['yum']['mysql-connectors-community']['repositoryid'] + sslcacert node['yum']['mysql-connectors-community']['sslcacert'] + sslclientcert node['yum']['mysql-connectors-community']['sslclientcert'] + sslclientkey node['yum']['mysql-connectors-community']['sslclientkey'] + sslverify node['yum']['mysql-connectors-community']['sslverify'] + timeout node['yum']['mysql-connectors-community']['timeout'] + action :create +end diff --git a/vagrant/chef/cookbooks/yum-mysql-community/recipes/mysql55.rb b/vagrant/chef/cookbooks/yum-mysql-community/recipes/mysql55.rb new file mode 100644 index 00000000000..4176ea742a2 --- /dev/null +++ b/vagrant/chef/cookbooks/yum-mysql-community/recipes/mysql55.rb @@ -0,0 +1,48 @@ +# +# Author:: Sean OMeara () +# Recipe:: yum-mysql-community::mysql55 +# +# Copyright 2014, 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. + +yum_repository 'mysql55-community' do + description node['yum']['mysql55-community']['description'] + baseurl node['yum']['mysql55-community']['baseurl'] + mirrorlist node['yum']['mysql55-community']['mirrorlist'] + gpgcheck node['yum']['mysql55-community']['gpgcheck'] + gpgkey node['yum']['mysql55-community']['gpgkey'] + enabled node['yum']['mysql55-community']['enabled'] + cost node['yum']['mysql55-community']['cost'] + exclude node['yum']['mysql55-community']['exclude'] + enablegroups node['yum']['mysql55-community']['enablegroups'] + failovermethod node['yum']['mysql55-community']['failovermethod'] + http_caching node['yum']['mysql55-community']['http_caching'] + include_config node['yum']['mysql55-community']['include_config'] + includepkgs node['yum']['mysql55-community']['includepkgs'] + keepalive node['yum']['mysql55-community']['keepalive'] + max_retries node['yum']['mysql55-community']['max_retries'] + metadata_expire node['yum']['mysql55-community']['metadata_expire'] + mirror_expire node['yum']['mysql55-community']['mirror_expire'] + priority node['yum']['mysql55-community']['priority'] + proxy node['yum']['mysql55-community']['proxy'] + proxy_username node['yum']['mysql55-community']['proxy_username'] + proxy_password node['yum']['mysql55-community']['proxy_password'] + repositoryid node['yum']['mysql55-community']['repositoryid'] + sslcacert node['yum']['mysql55-community']['sslcacert'] + sslclientcert node['yum']['mysql55-community']['sslclientcert'] + sslclientkey node['yum']['mysql55-community']['sslclientkey'] + sslverify node['yum']['mysql55-community']['sslverify'] + timeout node['yum']['mysql55-community']['timeout'] + action :create +end diff --git a/vagrant/chef/cookbooks/yum-mysql-community/recipes/mysql56.rb b/vagrant/chef/cookbooks/yum-mysql-community/recipes/mysql56.rb new file mode 100644 index 00000000000..c866cd904da --- /dev/null +++ b/vagrant/chef/cookbooks/yum-mysql-community/recipes/mysql56.rb @@ -0,0 +1,48 @@ +# +# Author:: Sean OMeara () +# Recipe:: yum-mysql-community::mysql56-community +# +# Copyright 2014, 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. + +yum_repository 'mysql56-community' do + description node['yum']['mysql56-community']['description'] + baseurl node['yum']['mysql56-community']['baseurl'] + mirrorlist node['yum']['mysql56-community']['mirrorlist'] + gpgcheck node['yum']['mysql56-community']['gpgcheck'] + gpgkey node['yum']['mysql56-community']['gpgkey'] + enabled node['yum']['mysql56-community']['enabled'] + cost node['yum']['mysql56-community']['cost'] + exclude node['yum']['mysql56-community']['exclude'] + enablegroups node['yum']['mysql56-community']['enablegroups'] + failovermethod node['yum']['mysql56-community']['failovermethod'] + http_caching node['yum']['mysql56-community']['http_caching'] + include_config node['yum']['mysql56-community']['include_config'] + includepkgs node['yum']['mysql56-community']['includepkgs'] + keepalive node['yum']['mysql56-community']['keepalive'] + max_retries node['yum']['mysql56-community']['max_retries'] + metadata_expire node['yum']['mysql56-community']['metadata_expire'] + mirror_expire node['yum']['mysql56-community']['mirror_expire'] + priority node['yum']['mysql56-community']['priority'] + proxy node['yum']['mysql56-community']['proxy'] + proxy_username node['yum']['mysql56-community']['proxy_username'] + proxy_password node['yum']['mysql56-community']['proxy_password'] + repositoryid node['yum']['mysql56-community']['repositoryid'] + sslcacert node['yum']['mysql56-community']['sslcacert'] + sslclientcert node['yum']['mysql56-community']['sslclientcert'] + sslclientkey node['yum']['mysql56-community']['sslclientkey'] + sslverify node['yum']['mysql56-community']['sslverify'] + timeout node['yum']['mysql56-community']['timeout'] + action :create +end diff --git a/vagrant/chef/cookbooks/yum-mysql-community/recipes/mysql57.rb b/vagrant/chef/cookbooks/yum-mysql-community/recipes/mysql57.rb new file mode 100644 index 00000000000..56e013f6036 --- /dev/null +++ b/vagrant/chef/cookbooks/yum-mysql-community/recipes/mysql57.rb @@ -0,0 +1,48 @@ +# +# Author:: Sean OMeara () +# Recipe:: yum-mysql-community::mysql57-community +# +# Copyright 2014, 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. + +yum_repository 'mysql57-community' do + description node['yum']['mysql57-community']['description'] + baseurl node['yum']['mysql57-community']['baseurl'] + mirrorlist node['yum']['mysql57-community']['mirrorlist'] + gpgcheck node['yum']['mysql57-community']['gpgcheck'] + gpgkey node['yum']['mysql57-community']['gpgkey'] + enabled node['yum']['mysql57-community']['enabled'] + cost node['yum']['mysql57-community']['cost'] + exclude node['yum']['mysql57-community']['exclude'] + enablegroups node['yum']['mysql57-community']['enablegroups'] + failovermethod node['yum']['mysql57-community']['failovermethod'] + http_caching node['yum']['mysql57-community']['http_caching'] + include_config node['yum']['mysql57-community']['include_config'] + includepkgs node['yum']['mysql57-community']['includepkgs'] + keepalive node['yum']['mysql57-community']['keepalive'] + max_retries node['yum']['mysql57-community']['max_retries'] + metadata_expire node['yum']['mysql57-community']['metadata_expire'] + mirror_expire node['yum']['mysql57-community']['mirror_expire'] + priority node['yum']['mysql57-community']['priority'] + proxy node['yum']['mysql57-community']['proxy'] + proxy_username node['yum']['mysql57-community']['proxy_username'] + proxy_password node['yum']['mysql57-community']['proxy_password'] + repositoryid node['yum']['mysql57-community']['repositoryid'] + sslcacert node['yum']['mysql57-community']['sslcacert'] + sslclientcert node['yum']['mysql57-community']['sslclientcert'] + sslclientkey node['yum']['mysql57-community']['sslclientkey'] + sslverify node['yum']['mysql57-community']['sslverify'] + timeout node['yum']['mysql57-community']['timeout'] + action :create +end diff --git a/vagrant/chef/cookbooks/yum/CHANGELOG.md b/vagrant/chef/cookbooks/yum/CHANGELOG.md new file mode 100644 index 00000000000..d85712ef6ae --- /dev/null +++ b/vagrant/chef/cookbooks/yum/CHANGELOG.md @@ -0,0 +1,236 @@ +yum Cookbook CHANGELOG +====================== +This file is used to list changes made in each version of the yum cookbook. + +v3.3.2 (2014-09-11) +------------------- +- Fix globalconfig resource param for http_caching + +v3.3.0 (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 +- Updating regex for mirror_expire and mirrorlist_expire to include /^\d+[mhd]$/ +- Updating README so keepcache reflects reality (defaults to false) +- Changing 'obsoletes' behavior in globalconfig resource to match + default behavior. (now defaults to nil, yum defaults to false) +- Adding makecache action to repository resource +- Adding mode parameter to repository resource. Defaults to '0644'. + +v3.2.4 (2014-08-20) +------------------- +#82 - Adding a makecache parameter + +v3.2.2 (2014-06-11) +------------------- +#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 +- PR #64 - Fix validation of 'metadata_expire' option to match documentation +- [COOK-3591] - removing node.name from repo template rendering +- [COOK-4275] - Enhancements to yum cookbook +- Adding full spec coverage +- 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.opscode.com/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.opscode.com/browse/COOK-3689)** - Fix warnings about resource cloning +- **[COOK-3574](https://tickets.opscode.com/browse/COOK-3574)** - Add missing "description" field in metadata + + +v2.3.2 +------ +### Bug +- **[COOK-3145](https://tickets.opscode.com/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 +- [COOK-2399] - yum cookbook LWRPs fail FoodCritic +- [COOK-2519] - Add priority option to Yum repo files +- [COOK-2593] - allow integer or string for yum priority +- [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 +- [COOK-1272], [COOK-1302] - update RPM file for CentOS / RHEL 6 +- [COOK-1330] - update cookbook documentation on excludes for yum +- [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. diff --git a/vagrant/chef/cookbooks/yum/README.md b/vagrant/chef/cookbooks/yum/README.md new file mode 100644 index 00000000000..d84a5d3b3c0 --- /dev/null +++ b/vagrant/chef/cookbooks/yum/README.md @@ -0,0 +1,278 @@ +yum Cookbook +============ + +[![Cookbook Version](https://img.shields.io/cookbook/v/yum.svg)](https://supermarket.getchef.com/cookbooks/yum) +[![Travis status](http://img.shields.io/travis/opscode-cookbooks/yum.svg)](https://travis-ci.org/opscode-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 + +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. + +Requirements +------------ +* Chef 11 or higher +* Ruby 1.9 (preferably from the Chef full-stack installer) +* RHEL5, RHEL6, or other platforms within the family + +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 +* `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. +* `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. + +### 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 +``` ruby +yum_globalconfig '/my/chroot/etc/yum.conf' do + cachedir '/my/chroot/etc/yum.conf' + keepcache 'yes' + debuglevel '2' + installroot '/my/chroot' + action :create +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 + +* `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'. +* `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` +* `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. + +Recipes +------- +* `default` - Configures `yum_globalconfig[/etc/yum.conf]` with values + found in node attributes at `node['yum']['main']` + +Attributes +---------- +The following attributes are set by default + +``` ruby +default['yum']['main']['cachedir'] = '/var/cache/yum/$basearch/$releasever' +default['yum']['main']['keepcache'] = false +default['yum']['main']['debuglevel'] = nil +default['yum']['main']['exclude'] = nil +default['yum']['main']['logfile'] = '/var/log/yum.log' +default['yum']['main']['exactarch'] = nil +default['yum']['main']['obsoletes'] = nil +default['yum']['main']['installonly_limit'] = nil +default['yum']['main']['installonlypkgs'] = nil +default['yum']['main']['installroot'] = nil +``` + +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 +* yum-epel +* yum-elrepo +* yum-repoforge +* yum-ius +* yum-percona +* 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 () +- Author:: Joshua Timberman () +- Author:: Sean OMeara () + +```text +Copyright:: 2011 Eric G. Wolfe +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. +``` diff --git a/vagrant/chef/cookbooks/yum/attributes/main.rb b/vagrant/chef/cookbooks/yum/attributes/main.rb new file mode 100644 index 00000000000..f1b68db1a6b --- /dev/null +++ b/vagrant/chef/cookbooks/yum/attributes/main.rb @@ -0,0 +1,96 @@ +# http://linux.die.net/man/5/yum.conf +case node['platform_version'].to_i +when 5 + default['yum']['main']['cachedir'] = '/var/cache/yum' +else + default['yum']['main']['cachedir'] = '/var/cache/yum/$basearch/$releasever' +end + +case node['platform'] +when 'amazon' + default['yum']['main']['distroverpkg'] = 'system-release' +when 'scientific' + default['yum']['main']['distroverpkg'] = 'sl-release' +else + default['yum']['main']['distroverpkg'] = "#{node['platform']}-release" +end + +default['yum']['main']['alwaysprompt'] = nil # [TrueClass, FalseClass] +default['yum']['main']['assumeyes'] = nil # [TrueClass, FalseClass] +default['yum']['main']['bandwidth'] = nil # /^\d+$/ +default['yum']['main']['bugtracker_url'] = nil # /.*/ +default['yum']['main']['clean_requirements_on_remove'] = nil # [TrueClass, FalseClass] +default['yum']['main']['color'] = nil # %w{ always never } +default['yum']['main']['color_list_available_downgrade'] = nil # /.*/ +default['yum']['main']['color_list_available_install'] = nil # /.*/ +default['yum']['main']['color_list_available_reinstall'] = nil # /.*/ +default['yum']['main']['color_list_available_upgrade'] = nil # /.*/ +default['yum']['main']['color_list_installed_extra'] = nil # /.*/ +default['yum']['main']['color_list_installed_newer'] = nil # /.*/ +default['yum']['main']['color_list_installed_older'] = nil # /.*/ +default['yum']['main']['color_list_installed_reinstall'] = nil # /.*/ +default['yum']['main']['color_search_match'] = nil # /.*/ +default['yum']['main']['color_update_installed'] = nil # /.*/ +default['yum']['main']['color_update_local'] = nil # /.*/ +default['yum']['main']['color_update_remote'] = nil # /.*/ +default['yum']['main']['commands'] = nil # /.*/ +default['yum']['main']['debuglevel'] = nil # /^\d+$/ +default['yum']['main']['diskspacecheck'] = nil # [TrueClass, FalseClass] +default['yum']['main']['enable_group_conditionals'] = nil # [TrueClass, FalseClass] +default['yum']['main']['errorlevel'] = nil # /^\d+$/ +default['yum']['main']['exactarch'] = nil # [TrueClass, FalseClass] +default['yum']['main']['exclude'] = nil # /.*/ +default['yum']['main']['gpgcheck'] = true # [TrueClass, FalseClass] +default['yum']['main']['group_package_types'] = nil # /.*/ +default['yum']['main']['groupremove_leaf_only'] = nil # [TrueClass, FalseClass] +default['yum']['main']['history_list_view'] = nil # /.*/ +default['yum']['main']['history_record'] = nil # [TrueClass, FalseClass] +default['yum']['main']['history_record_packages'] = nil # /.*/ +default['yum']['main']['http_caching'] = nil # %w{ packages all none } +default['yum']['main']['installonly_limit'] = nil # /\d+/, /keep/ +default['yum']['main']['installonlypkgs'] = nil # /.*/ +default['yum']['main']['installroot'] = nil # /.*/ +default['yum']['main']['keepalive'] = nil # [TrueClass, FalseClass] +default['yum']['main']['keepcache'] = false # [TrueClass, FalseClass] +default['yum']['main']['kernelpkgnames'] = nil # /.*/ +default['yum']['main']['localpkg_gpgcheck'] = nil # [TrueClass,# FalseClass] +default['yum']['main']['logfile'] = '/var/log/yum.log' # /.*/ +default['yum']['main']['max_retries'] = nil # /^\d+$/ +default['yum']['main']['mdpolicy'] = nil # %w{ packages all none } +default['yum']['main']['metadata_expire'] = nil # /^\d+$/ +default['yum']['main']['mirrorlist_expire'] = nil # /^\d+$/ +default['yum']['main']['multilib_policy'] = nil # %w{ all best } +default['yum']['main']['obsoletes'] = nil # [TrueClass, FalseClass] +default['yum']['main']['overwrite_groups'] = nil # [TrueClass, FalseClass] +default['yum']['main']['password'] = nil # /.*/ +default['yum']['main']['path'] = '/etc/yum.conf' # /.*/ +default['yum']['main']['persistdir'] = nil # /.*/ +default['yum']['main']['pluginconfpath'] = nil # /.*/ +default['yum']['main']['pluginpath'] = nil # /.*/ +default['yum']['main']['plugins'] = nil # [TrueClass, FalseClass] +default['yum']['main']['protected_multilib'] = nil # /.*/ +default['yum']['main']['protected_packages'] = nil # /.*/ +default['yum']['main']['proxy'] = nil # /.*/ +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']['reset_nice'] = nil # [TrueClass, FalseClass] +default['yum']['main']['rpmverbosity'] = nil # %w{ info critical# emergency error warn debug } +default['yum']['main']['showdupesfromrepos'] = nil # [TrueClass, FalseClass] +default['yum']['main']['skip_broken'] = nil # [TrueClass, FalseClass] +default['yum']['main']['ssl_check_cert_permissions'] = nil # [TrueClass, FalseClass] +default['yum']['main']['sslcacert'] = nil # /.*/ +default['yum']['main']['sslclientcert'] = nil # /.*/ +default['yum']['main']['sslclientkey'] = nil # /.*/ +default['yum']['main']['sslverify'] = nil # [TrueClass, FalseClass] +default['yum']['main']['syslog_device'] = nil # /.*/ +default['yum']['main']['syslog_facility'] = nil # /.*/ +default['yum']['main']['syslog_ident'] = nil # /.*/ +default['yum']['main']['throttle'] = nil # [/\d+k/, /\d+M/, /\d+G/] +default['yum']['main']['timeout'] = nil # /\d+/ +default['yum']['main']['tolerant'] = false +default['yum']['main']['tsflags'] = nil # /.*/ +default['yum']['main']['username'] = nil # /.*/ diff --git a/vagrant/chef/cookbooks/yum/libraries/matchers.rb b/vagrant/chef/cookbooks/yum/libraries/matchers.rb new file mode 100644 index 00000000000..433347b87e7 --- /dev/null +++ b/vagrant/chef/cookbooks/yum/libraries/matchers.rb @@ -0,0 +1,27 @@ +# 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 + + def delete_yum_globalconfig(resource_name) + ChefSpec::Matchers::ResourceMatcher.new(:yum_globalconfig, :delete, resource_name) + end +end diff --git a/vagrant/chef/cookbooks/yum/metadata.json b/vagrant/chef/cookbooks/yum/metadata.json new file mode 100644 index 00000000000..9983f70b6cd --- /dev/null +++ b/vagrant/chef/cookbooks/yum/metadata.json @@ -0,0 +1,34 @@ +{ + "name": "yum", + "version": "3.3.2", + "description": "Configures various yum components on Red Hat-like systems", + "long_description": "", + "maintainer": "Chef", + "maintainer_email": "cookbooks@getchef.com", + "license": "Apache 2.0", + "platforms": { + "redhat": ">= 0.0.0", + "centos": ">= 0.0.0", + "scientific": ">= 0.0.0", + "amazon": ">= 0.0.0", + "fedora": ">= 0.0.0" + }, + "dependencies": { + }, + "recommendations": { + }, + "suggestions": { + }, + "conflicting": { + }, + "providing": { + }, + "replacing": { + }, + "attributes": { + }, + "groupings": { + }, + "recipes": { + } +} \ No newline at end of file diff --git a/vagrant/chef/cookbooks/yum/metadata.rb b/vagrant/chef/cookbooks/yum/metadata.rb new file mode 100644 index 00000000000..81f404bf5bf --- /dev/null +++ b/vagrant/chef/cookbooks/yum/metadata.rb @@ -0,0 +1,12 @@ +name 'yum' +maintainer 'Chef' +maintainer_email 'cookbooks@getchef.com' +license 'Apache 2.0' +description 'Configures various yum components on Red Hat-like systems' +version '3.3.2' + +supports 'redhat' +supports 'centos' +supports 'scientific' +supports 'amazon' +supports 'fedora' diff --git a/vagrant/chef/cookbooks/yum/providers/globalconfig.rb b/vagrant/chef/cookbooks/yum/providers/globalconfig.rb new file mode 100644 index 00000000000..84354e1b20e --- /dev/null +++ b/vagrant/chef/cookbooks/yum/providers/globalconfig.rb @@ -0,0 +1,37 @@ +# +# Cookbook Name:: yum +# Provider:: repository +# +# Author:: Sean OMeara +# 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) + +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 diff --git a/vagrant/chef/cookbooks/yum/providers/repository.rb b/vagrant/chef/cookbooks/yum/providers/repository.rb new file mode 100644 index 00000000000..71713985a9e --- /dev/null +++ b/vagrant/chef/cookbooks/yum/providers/repository.rb @@ -0,0 +1,99 @@ +# +# Cookbook Name:: yum +# Provider:: repository +# +# Author:: Sean OMeara +# 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. + + 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 + variables(:config => new_resource) + if new_resource.make_cache + notifies :run, "execute[yum-makecache-#{new_resource.repositoryid}]", :immediately + notifies :create, "ruby_block[yum-cache-reload-#{new_resource.repositoryid}]", :immediately + end + end + + # get the metadata for this repo only + execute "yum-makecache-#{new_resource.repositoryid}" do + command "yum -q makecache --disablerepo=* --enablerepo=#{new_resource.repositoryid}" + action :nothing + 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 #{new_resource.repositoryid}]", :immediately + notifies :create, "ruby_block[yum-cache-reload-#{new_resource.repositoryid}]", :immediately + end + + execute "yum clean #{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 diff --git a/vagrant/chef/cookbooks/yum/recipes/default.rb b/vagrant/chef/cookbooks/yum/recipes/default.rb new file mode 100644 index 00000000000..7001d5d41c0 --- /dev/null +++ b/vagrant/chef/cookbooks/yum/recipes/default.rb @@ -0,0 +1,98 @@ +# +# Author:: Sean OMeara () +# Recipe:: yum::default +# +# 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. + +yum_globalconfig '/etc/yum.conf' do + alwaysprompt node['yum']['main']['alwaysprompt'] + assumeyes node['yum']['main']['assumeyes'] + bandwidth node['yum']['main']['bandwidth'] + bugtracker_url node['yum']['main']['bugtracker_url'] + clean_requirements_on_remove node['yum']['main']['clean_requirements_on_remove'] + color node['yum']['main']['color'] + color_list_available_downgrade node['yum']['main']['color_list_available_downgrade'] + color_list_available_install node['yum']['main']['color_list_available_install'] + color_list_available_reinstall node['yum']['main']['color_list_available_reinstall'] + color_list_available_upgrade node['yum']['main']['color_list_available_upgrade'] + color_list_installed_extra node['yum']['main']['color_list_installed_extra'] + color_list_installed_newer node['yum']['main']['color_list_installed_newer'] + color_list_installed_older node['yum']['main']['color_list_installed_older'] + color_list_installed_reinstall node['yum']['main']['color_list_installed_reinstall'] + color_search_match node['yum']['main']['color_search_match'] + color_update_installed node['yum']['main']['color_update_installed'] + color_update_local node['yum']['main']['color_update_local'] + color_update_remote node['yum']['main']['color_update_remote'] + debuglevel node['yum']['main']['debuglevel'] + diskspacecheck node['yum']['main']['diskspacecheck'] + enable_group_conditionals node['yum']['main']['enable_group_conditionals'] + errorlevel node['yum']['main']['errorlevel'] + exactarch node['yum']['main']['exactarch'] + exclude node['yum']['main']['exclude'] + gpgcheck node['yum']['main']['gpgcheck'] + group_package_types node['yum']['main']['group_package_types'] + groupremove_leaf_only node['yum']['main']['groupremove_leaf_only'] + history_list_view node['yum']['main']['history_list_view'] + history_record node['yum']['main']['history_record'] + history_record_packages node['yum']['main']['history_record_packages'] + http_caching node['yum']['main']['http_caching'] + installonly_limit node['yum']['main']['installonly_limit'] + installonlypkgs node['yum']['main']['installonlypkgs'] + installroot node['yum']['main']['installroot'] + keepalive node['yum']['main']['keepalive'] + keepcache node['yum']['main']['keepcache'] + kernelpkgnames node['yum']['main']['kernelpkgnames'] + localpkg_gpgcheck node['yum']['main']['localpkg_gpgcheck'] + logfile node['yum']['main']['logfile'] + max_retries node['yum']['main']['max_retries'] + mdpolicy node['yum']['main']['mdpolicy'] + metadata_expire node['yum']['main']['metadata_expire'] + mirrorlist_expire node['yum']['main']['mirrorlist_expire'] + multilib_policy node['yum']['main']['multilib_policy'] + obsoletes node['yum']['main']['obsoletes'] + overwrite_groups node['yum']['main']['overwrite_groups'] + password node['yum']['main']['password'] + path node['yum']['main']['path'] + persistdir node['yum']['main']['persistdir'] + pluginconfpath node['yum']['main']['pluginconfpath'] + pluginpath node['yum']['main']['pluginpath'] + plugins node['yum']['main']['plugins'] + protected_multilib node['yum']['main']['protected_multilib'] + protected_packages node['yum']['main']['protected_packages'] + proxy node['yum']['main']['proxy'] + proxy_username node['yum']['main']['proxy_username'] + proxy_password node['yum']['main']['proxy_password'] + username node['yum']['main']['username'] + password node['yum']['main']['password'] + recent node['yum']['main']['recent'] + releasever node['yum']['main']['releasever'] + repo_gpgcheck node['yum']['main']['repo_gpgcheck'] + reset_nice node['yum']['main']['reset_nice'] + rpmverbosity node['yum']['main']['rpmverbosity'] + showdupesfromrepos node['yum']['main']['showdupesfromrepos'] + skip_broken node['yum']['main']['skip_broken'] + ssl_check_cert_permissions node['yum']['main']['ssl_check_cert_permissions'] + sslcacert node['yum']['main']['sslcacert'] + sslclientcert node['yum']['main']['sslclientcert'] + sslclientkey node['yum']['main']['sslclientkey'] + syslog_device node['yum']['main']['syslog_device'] + syslog_facility node['yum']['main']['syslog_facility'] + syslog_ident node['yum']['main']['syslog_ident'] + throttle node['yum']['main']['throttle'] + timeout node['yum']['main']['timeout'] + tolerant node['yum']['main']['tolerant'] + tsflags node['yum']['main']['tsflags'] + action :create +end diff --git a/vagrant/chef/cookbooks/yum/resources/globalconfig.rb b/vagrant/chef/cookbooks/yum/resources/globalconfig.rb new file mode 100644 index 00000000000..9b5f77f203b --- /dev/null +++ b/vagrant/chef/cookbooks/yum/resources/globalconfig.rb @@ -0,0 +1,107 @@ +# +# Cookbook Name:: yum +# Resource:: repository +# +# Author:: Sean OMeara +# 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 + +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 :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 => /.*/, :default => nil, :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 :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 diff --git a/vagrant/chef/cookbooks/yum/resources/repository.rb b/vagrant/chef/cookbooks/yum/resources/repository.rb new file mode 100644 index 00000000000..5a3509557d7 --- /dev/null +++ b/vagrant/chef/cookbooks/yum/resources/repository.rb @@ -0,0 +1,67 @@ +# +# Cookbook Name:: yum +# Resource:: repository +# +# Author:: Sean OMeara +# 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 :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, :regex => /.*/, :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 :report_instanceid, :kind_of => [TrueClass, FalseClass], :default => nil +attribute :repositoryid, :kind_of => String, :regex => /.*/, :name_attribute => true +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 => true +attribute :timeout, :kind_of => String, :regex => /^\d+$/, :default => nil + +attribute :options, :kind_of => Hash + +alias_method :url, :baseurl +alias_method :keyurl, :gpgkey diff --git a/vagrant/chef/cookbooks/yum/templates/default/main.erb b/vagrant/chef/cookbooks/yum/templates/default/main.erb new file mode 100644 index 00000000000..35725d00515 --- /dev/null +++ b/vagrant/chef/cookbooks/yum/templates/default/main.erb @@ -0,0 +1,266 @@ +# This file was generated by Chef +# Do NOT modify this file by hand. + +[main] +<% if @config.alwaysprompt %> +alwaysprompt=<%= @config.alwaysprompt %> +<% end %> +<% if @config.assumeyes %> +assumeyes=<%= @config.assumeyes %> +<% end %> +<% if @config.bandwidth %> +bandwidth=<%= @config.bandwidth %> +<% end %> +<% if @config.bugtracker_url %> +bugtracker_url=<%= @config.bugtracker_url %> +<% end %> +<% if @config.cachedir %> +cachedir=<%= @config.cachedir %> +<% end %> +<% if @config.clean_requirements_on_remove %> +clean_requirements_on_remove=<%= @config.clean_requirements_on_remove %> +<% end %> +<% if @config.color %> +color=<%= @config.color %> +<% end %> +<% if @config.color_list_available_downgrade %> +color_list_available_downgrade=<%= @config.color_list_available_downgrade %> +<% end %> +<% if @config.color_list_available_install %> +color_list_available_install=<%= @config.color_list_available_install %> +<% end %> +<% if @config.color_list_available_reinstall %> +color_list_available_reinstall=<%= @config.color_list_available_reinstall %> +<% end %> +<% if @config.color_list_available_upgrade %> +color_list_available_upgrade=<%= @config.color_list_available_upgrade %> +<% end %> +<% if @config.color_list_installed_extra %> +color_list_installed_extra=<%= @config.color_list_installed_extra %> +<% end %> +<% if @config.color_list_installed_newer %> +color_list_installed_newer=<%= @config.color_list_installed_newer %> +<% end %> +<% if @config.color_list_installed_older %> +color_list_installed_older=<%= @config.color_list_installed_older %> +<% end %> +<% if @config.color_list_installed_reinstall %> +color_list_installed_reinstall=<%= @config.color_list_installed_reinstall %> +<% end %> +<% if @config.color_search_match %> +color_search_match=<%= @config.color_search_match %> +<% end %> +<% if @config.color_update_installed %> +color_update_installed=<%= @config.color_update_installed %> +<% end %> +<% if @config.color_update_local %> +color_update_local=<%= @config.color_update_local %> +<% end %> +<% if @config.color_update_remote %> +color_update_remote=<%= @config.color_update_remote %> +<% end %> +<% if @config.commands %> +commands=<%= @config.commands %> +<% end %> +<% if @config.debuglevel %> +debuglevel=<%= @config.debuglevel %> +<% end %> +<% if @config.diskspacecheck %> +diskspacecheck=<%= @config.diskspacecheck %> +<% end %> +<% if @config.distroverpkg %> +distroverpkg=<%= @config.distroverpkg %> +<% end %> +<% if @config.enable_group_conditionals %> +enable_group_conditionals=1 +<% end %> +<% if @config.errorlevel %> +errorlevel=<%= @config.errorlevel %> +<% end %> +<% if @config.exactarch %> +exactarch=1 +<% else %> +exactarch=0 +<% end %> +<% if @config.exclude %> +exclude=<%= @config.exclude %> +<% end %> +<% if @config.gpgcheck %> +gpgcheck=1 +<% else %> +gpgcheck=0 +<% end %> +<% if @config.group_package_types %> +group_package_types=<%= @config.group_package_types %> +<% end %> +<% if @config.groupremove_leaf_only %> +groupremove_leaf_only=<%= @config.groupremove_leaf_only %> +<% end %> +<% if @config.history_list_view %> +history_list_view=<%= @config.history_list_view %> +<% end %> +<% if @config.history_record %> +history_record=<%= @config.history_record %> +<% end %> +<% if @config.history_record_packages %> +history_record_packages=<%= @config.history_record_packages %> +<% end %> +<% if @config.http_caching %> +http_caching=<%= @config.http_caching %> +<% end %> +<% if @config.installonly_limit %> +installonly_limit=<%= @config.installonly_limit %> +<% end %> +<% if @config.installonlypkgs %> +installonlypkgs=<%= @config.installonlypkgs %> +<% end %> +<% if @config.installroot %> +installroot=<%= @config.installroot %> +<% end %> +<% if @config.keepalive %> +keepalive=<%= @config.keepalive %> +<% end %> +<% if @config.keepcache %> +keepcache=1 +<% else %> +keepcache=0 +<% end %> +<% if @config.kernelpkgnames %> +kernelpkgnames=<%= @config.kernelpkgnames %> +<% end %> +<% if @config.localpkg_gpgcheck %> +localpkg_gpgcheck=<%= @config.localpkg_gpgcheck %> +<% end %> +<% if @config.logfile %> +logfile=<%= @config.logfile %> +<% end %> +<% if @config.max_retries %> +max_retries=<%= @config.max_retries %> +<% end %> +<% if @config.mdpolicy %> +mdpolicy=<%= @config.mdpolicy %> +<% end %> +<% if @config.metadata_expire %> +metadata_expire=<%= @config.metadata_expire %> +<% end %> +<% if @config.mirrorlist_expire %> +mirrorlist_expire=<%= @config.mirrorlist_expire %> +<% end %> +<% if @config.multilib_policy %> +multilib_policy=<%= @config.multilib_policy %> +<% end %> +<% if @config.obsoletes %> +obsoletes=1 +<% else %> +obsoletes=0 +<% end %> +<% if @config.overwrite_groups %> +overwrite_groups=<%= @config.overwrite_groups %> +<% end %> +<% if @config.password %> +password=<%= @config.password %> +<% end %> +<% if @config.persistdir %> +persistdir=<%= @config.persistdir %> +<% end %> +<% if @config.pluginconfpath %> +pluginconfpath=<%= @config.pluginconfpath %> +<% end %> +<% if @config.pluginpath %> +pluginpath=<%= @config.pluginpath %> +<% end %> +<% if @config.plugins %> +plugins=1 +<% else %> +plugins=0 +<% end %> +<% if @config.protected_multilib %> +protected_multilib=<%= @config.protected_multilib %> +<% end %> +<% if @config.protected_packages %> +protected_packages=<%= @config.protected_packages %> +<% end %> +<% if @config.proxy %> +proxy=<%= @config.proxy %> +<% end %> +<% if @config.proxy_password %> +proxy_password=<%= @config.proxy_password %> +<% end %> +<% if @config.proxy_username %> +proxy_username=<%= @config.proxy_username %> +<% end %> +<% if @config.recent %> +recent=<%= @config.recent %> +<% end %> +<% if @config.releasever %> +releasever=<%= @config.releasever %> +<% end %> +<% if @config.repo_gpgcheck %> +repo_gpgcheck=<%= @config.repo_gpgcheck %> +<% end %> +<% if @config.reset_nice %> +reset_nice=<%= @config.reset_nice %> +<% end %> +<% if @config.rpmverbosity %> +rpmverbosity=<%= @config.rpmverbosity %> +<% end %> +<% if @config.showdupesfromrepos %> +showdupesfromrepos=<%= @config.showdupesfromrepos %> +<% end %> +<% if @config.skip_broken %> +skip_broken=<%= @config.skip_broken %> +<% end %> +<% if @config.ssl_check_cert_permissions %> +ssl_check_cert_permissions=<%= @config.ssl_check_cert_permissions %> +<% 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 %> +<% end %> +<% if @config.syslog_device %> +syslog_device=<%= @config.syslog_device %> +<% end %> +<% if @config.syslog_facility %> +syslog_facility=<%= @config.syslog_facility %> +<% end %> +<% if @config.syslog_ident %> +syslog_ident=<%= @config.syslog_ident %> +<% end %> +<% if @config.throttle %> +throttle=<%= @config.throttle %> +<% end %> +<% if @config.timeout %> +timeout=<%= @config.timeout %> +<% end %> +<% if @config.tolerant %> +tolerant=<%= @config.tolerant %> +<% end %> +<% if @config.tsflags %> +tsflags=<%= @config.tsflags %> +<% end %> +<% if @config.username %> +username=<%= @config.username %> +<% 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 -%> diff --git a/vagrant/chef/cookbooks/yum/templates/default/repo.erb b/vagrant/chef/cookbooks/yum/templates/default/repo.erb new file mode 100644 index 00000000000..06409da5a1d --- /dev/null +++ b/vagrant/chef/cookbooks/yum/templates/default/repo.erb @@ -0,0 +1,122 @@ +# 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.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 %> +<% 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 -%> diff --git a/vagrant/chef/data_bags/tomcat_users/fhir.json b/vagrant/chef/data_bags/tomcat_users/fhir.json new file mode 100644 index 00000000000..3bf98cc09bc --- /dev/null +++ b/vagrant/chef/data_bags/tomcat_users/fhir.json @@ -0,0 +1,9 @@ +{ + "id": "fhir", + "password": "FHIRDefaultPassword", + "roles": [ + "manager", + "admin", + "manager-gui" + ] +} diff --git a/vagrant/chef/roles/.gitkeep b/vagrant/chef/roles/.gitkeep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/vagrant/data/.gitkeep b/vagrant/data/.gitkeep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/vagrant/screenshots/hapi-fhir-jpaserver.png b/vagrant/screenshots/hapi-fhir-jpaserver.png new file mode 100644 index 00000000000..e14fd1dc94d Binary files /dev/null and b/vagrant/screenshots/hapi-fhir-jpaserver.png differ diff --git a/vagrant/screenshots/tomcat.png b/vagrant/screenshots/tomcat.png new file mode 100644 index 00000000000..7c6f7ae110b Binary files /dev/null and b/vagrant/screenshots/tomcat.png differ