A RubyGem which helps out with some technical functionality to make life easier with chef.
- Chef Infra >= 14.0
- Gems
- berkshelf
- rake
- yard
Install gem using gem install chef-raketasks
or add it
to your Gemfile/.gemspec
Include the Gem via require 'chef-raketasks'
at the top of your
Rakefile. After that, just run rake -T
or rake --tasks
to see all
available tasks.
If you start a Rake task with parameters, please assure to not use spaces
between [ ]
. This will result in Don't know how to build task
errors.
Removes cache dirs from any local chef installation. Uses always the regular cache dirs of chef, chefdk and workstation.
Removes any temporary files from a cookbook. Based on your current position in your filesystem.
Removes any temporary files from an InSpec profile. Based on your current position in your filesystem.
Installs latest version of kitchen-static gem.
Installs kitchen-static
for kitchen.
version
: define a specific version of the gemsource
: define a different source than rubygems.org
Installs latest version of kitchen-vcenter and related gems.
Installs kitchen-vcenter for kitchen
version
: define a specific version of the gemsource
: define a different source than rubygems.org
Installs vcenter sdk for kitchen.
version
: define a specific version of the gemsource
: define a different source than rubygems.org
Vendors rubygems to a specific directory inside the cookbook
gemname
: the name of the gem to be usedversion
: define a specific version of the gemsource
: define a different source than rubygems.orginstalldir
: define the desired targetdir where the vendoring should happen
Package cookbook as .tgz file. Based on your current position in your filesystem.
Package InSpec profile as .tgz file
Generate new policyfile lock
Upload to Artifactory with required settings like:
endpoint
: defines the url of artifactoryapikey
: the api key from artifactory with the necessary rightsrepokey
: add the repokey for artifactorypath
: add the path within the repo
Upload to Chef Server. It uses the current configured supermarket in your knife.rb or config.rb.
Upload to Chef Supermarket. It uses the current configured supermarket in your knife.rb or config.rb.
You are also allowed to use multiple additional settings:
siteurl
: defines the url of a Chef Supermarketuser
: the user to authenticateauthkeyfile
: the keyfile to use (it must be a file present on your system)cookbookpath
: the path where to look up for cookbooks (default:../
)cookbookname
: define different cookbookname instead of the current oneconfigfile
: define a config.rb file instead of the settings above (this might look likerake release:supermarket[,,,,,~/.chef/config.rb]
)
Allows repinning dependencies in executables delivered with Chef Workstation. This is often needed if you do private/prerelease builds of Chef components like Kitchen drivers or InSpec plugins.
As the Chef installers hard-pin the versions in /opt/chef-workstation/bin
files, this needs the privileges to modify those files as well.
gem
: name of the dependencyversion
: new version to pin
See repin:chef-client
See repin:chef-client
See repin:chef-client
Run integration tests on AWS EC2
regexp
: Suite identifier (when callingkitchen windows test
, this would bewindows
. Default: all)action
: Kitchen action (default:test
)
For this, your .kitchen.yml
file gets merged with .kitchen.ec2.yml
which
includes the driver settings.
Example:
driver:
name: ec2
aws_ssh_key_id: testkitchen
region: eu-west-1
subnet_id: subnet-123456789
security_group_ids: [...]
iam_profile_name: ChefKitchen
instance_type: t3a.small
skip_cost_warning: true
tags:
Name: ChefKitchen
CreatedBy: test-kitchen
Details at https://github.com/test-kitchen/kitchen-ec2
Run integration tests using static IPs (e.g. physical hosts).
You can add some regex and action like you do with kitchen itself. The platform
specific file for this task is .kitchen.static.yml
.
Details at https://github.com/tecracer-theinen/kitchen-static
Run integration tests using Vagrant.
You can add some regex and action like you do with kitchen itself. The platform
specific file for this task is .kitchen.vagrant.yml
.
Details at https://github.com/test-kitchen/kitchen-vagrant
Run integration tests using vCenter.
You can add some regex and action like you do with kitchen itself. The platform
specific file for this task is .kitchen.vcenter.yml
.
Details at https://github.com/chef/kitchen-vcenter
Run linting tests for cookbook in current dir.
You can add true as option to auto-correct found issues that can be automatically fixed.
For information on contributing to this project see https://github.com/chef/chef/blob/master/CONTRIBUTING.md
- Report issues/questions/feature requests on [GitHub Issues][issues]
- Source hosted at [GitHub][repo]
Pull requests are very welcome! Make sure your patches are well tested. Ideally create a topic branch for every separate change you make. For example:
- Fork the repo
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes with signing them (
git commit -s -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Author:: Patrick Schaumburg (pschaumburg@tecracer.de)
Copyright:: Copyright (c) 2020 tecRacer Group
License:: Apache License, Version 2.0
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.