Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

The push-jobs cookbook has been deprecated

Author provided reason for deprecation:

The push-jobs cookbook has been deprecated and is no longer being maintained by its authors. Use of the push-jobs cookbook is no longer recommended.

RSS

push-jobs (33) Versions 4.0.2

Installs the Chef Push Jobs Client

Policyfile
Berkshelf
Knife
cookbook 'push-jobs', '= 4.0.2', :supermarket
cookbook 'push-jobs', '= 4.0.2'
knife supermarket install push-jobs
knife supermarket download push-jobs
README
Dependencies
Changelog
Quality 86%

push-jobs cookbook

Build Status Cookbook Version

Installs the Chef Push client package and sets it up to run as a service.

The official documentation is on docs.chef.io

Requirements

Requires Chef Server with the Chef Push Server add-on.

Platforms

  • Debian/Ubuntu
  • Windows

Tested with Test Kitchen suites on Ubuntu 12.04/14.04/16.04, CentOS 6/7, and Windows 2012 R2. It may work on other debian, rhel, or windows platform families with or without modification.

Chef

  • Chef 12.5+

Cookbooks

Usage

Include the default recipe in a node's run list. On Windows, the URL to the package to install and its SHA256 checksum are required so the package may be retrieved. Please note that if the URL cannot be parsed from the URL, the package_version attribute will also need to be set. For example:

node.default['push_jobs']['package_url'] = "http://www.example.com/pkgs/opscode-push-jobs-client-windows-1.1.5-1.windows.msi"
node.default['push_jobs']['package_checksum'] = "a-sha256-checksum"
node.default['push_jobs']['package_version'] = 'the-version-of-push-jobs' # optional - set this if the version of the installer cannot be parsed from the attribute package_url

Optionally, if you have a copy of the package on the local filesystem you can specify it to be used for the installation. For example:

node.default['push_jobs']['local_package_path'] = 'D:\\opscode-push-jobs-client-windows-1.1.5-1.windows.msi'

Set a whitelist of job names and their commands in the configuration file. This is automatically generated from the node['push_jobs']['whitelist'] attribute Hash, such as:

node.default['push_jobs']['whitelist'] = {
  "chef-client" => "chef-client",
  "apt-get-update" => "apt-get update"
}

As this is an attribute, interesting uses arise from orchestrating a Chef Client run. Assuming the above is present on the node prior to running the recipe, run Chef Client with this command from the local workstation:

knife job start chef-client A_NODE_NAME

New jobs can be added to the whitelist simply by creating attributes. This can be done with knife exec:

knife exec -E 'nodes.transform("name:A_NODE_NAME") do |n|
  n.set["push_jobs"]["whitelist"]["ntpdate"] = "ntpdate -u time"
end'

Then, run the chef-client job, and then the ntpdate job:

knife job start chef-client A_NODE_NAME
knife job start ntpdate A_NODE_NAME

Enabling 1.X Server Compatibility

If you're running the 2.X push jobs client with the 1.X server you'll need to set allow_unencrypted to true with this attribute:

node.default['push_jobs']['allow_unencrypted'] = true

Attributes

See attributes/default.rb for default values.

Recipes

There are several recipes in this cookbook, so they can be used all together (include the default recipe), or as necessary.

default

The default recipe includes the appropriate recipe based on the node's platform_family. It will raise an error if:

  • The package URL and checksum attributes are not set on Windows
  • The whitelist is not a Hash.
  • The node's platform is not supported.

config

This recipe ensures the platform-specific configuration directory (/etc/chef) is created, and renders the configuration file (push-jobs-client.rb) using the whitelist attribute. Any environment variables can be set using environment_variables attribute with key value pairs. You can provide your own push-jobs-client.rb.erb template file in a wrapper cookbook and set the ['config']['template_cookbook'] attribute to the name of that wrapper cookbook.

The path to the configuration file is set using the PushJobsHelper module's #config_path method. This is done to ensure the correct file path is used on Linux and Windows platforms, as it uses Chef::Config's #platform_specific_path method.

service

This recipe is responsible for handling the service resource based on the node's platform. On Linux (Debian and RHEL families), it will create a runit, upstart, or systemd service. upstart and systemd will be used where those are the native init system for your distro. If neither are available or default['push_jobs']['init_style'] is set to runit then runit will be installed and the service will use runit. On Windows nodes, the recipe will add a registry key for the Chef Push client, and manage the Windows service.

The service resources expect to be restarted if the configuration template is changed, using subscribes notification.

Client Connection Configuration

The push job client establishes a command and heartbeat channel to the push server over tcp. The tcp connection information is read from the Chef Server upon startup of the push client service from an endpoint similar to the following:

https://private-chef-server/organizations/org1/pushy/config/

The connection information for the push server is established when the push server is installed and the Chef Server is reconfigured. In the case the Chef Server is not providing the correct push server configuration, please verify hostnames are correct and that both the push server and Chef Server have been reconfigured.

Verify Push Jobs Client Connection

If the push client has been successfully installed on a node, the client should be able to successfully respond to a knife job directed to the node. If the node is not responding correctly, please consult the logs node['push_jobs']['logging_dir']/push-jobs-client.log (default: /var/log/chef/push-jobs-client.log) (for Debian and Rhel families) and look for entries similar to the following:

INFO: [pclient] Starting client ...
INFO: [pclient] Retrieving configuration from https://private-chef-server/organizations/org1/pushy/config/pc_6_1 ...
INFO: [pclient] Connecting to command channel at tcp://private-chef-server:10002
INFO: [pclient] Listening for server heartbeat at tcp://private-chef-server:10000
INFO: [pclient] Started client.

License & Authors

Copyright:: 2009-2016, Chef Software, Inc

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Dependent cookbooks

runit >= 1.2.0
chef-ingredient >= 0.19.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

push-jobs Cookbook CHANGELOG

This file is used to list changes made in each version of the push-jobs cookbook.

4.0.2 (2017-03-31)

  • set logging_dir per platform to resolve issues on Windows hosts

4.0.1 (2017-03-30)

  • Adding log location option
  • Test with Local Delivery instead of Rake
  • Update Apache license string in metadata
  • Allow 2.2 to be identified as 2.X

4.0.0 (2017-02-14)

  • Require Chef 12.5+ and remove compat_resource dependency

3.3.0 (2016-12-30)

  • Address 'No info for version' error on Windows by including a more useful error message along with adding documentation to the readme to let everyone know about the issue.
  • Add support for using a local Push Jobs package
  • Fix upstart service being restarted on every chef run
  • Require the latest compat_resource

3.2.2 (2016-09-21)

  • Push jobs doesn't actually require windows cookbook
  • Specify the minimum version of compat_resource and chef-ingredient
  • Expand platforms we test on and fix inspec tests

3.2.1 (2016-08-30)

  • Require a modern Windows cookbook to prevent random failures on Windows
  • Replace node.set with node.normal in the specs
  • Add chef_version to the metadata
  • Misc testing updates

v3.2.0 (2016-06-13)

  • Ensure that runit jobs are deleted when switching to systemd or upstart

v3.1.0 (2016-05-31)

  • Fixed not_if statements that prevented the service from being enabled under systemd
  • Fixed the service name under upstart to be chef-push-jobs-client not chef-push-jobs
  • Updated the systemd unit file to restart on failure
  • Added service inspec tests

v3.0.0 (2016-05-31)

Breaking changes

  • The opscode-push-jobs-client service has been renamed chef-push-jobs-client. If the existing opscode-push-jobs-client service exists on your system it will be stopped/disabled and removed before installing the new service
  • The install recipe will now install the chef-push-jobs-client service under systemd or upstart when running on nodes where those are the native init systems. Runit will continue to be used when running on sys-v init based nodes. You can continue to use runit by setting default['push_jobs']['service_name'] to 'runit'
  • The knife recipe has been removed. The push-jobs knife plugin can easily be installed on a workstation with a single chef_gem resource.
  • Support for 'container' as an init system option has been removed

Other changes

  • Converted serverspec tests to inspec
  • A new push_jobs_service provider has been added which supports setting up the push-jobs service in either upstart, systemd, or runit. The appropriate init system is selected automatically, but can also be forced by calling the full resource names. See the readme for additional properties and examples.
  • Added Chefspec matchers for the custom resources
  • Added Test Kitchen suites for the 1.0 release and the custom resources
  • Added a requirement for at least Runit 1.2.0, which was the first version that supported RHEL systems

v2.8.1 (2016-05-24)

  • Add attribute for setting allow_unencrypted in the config via a new attribute, which is required when 2.X clients connect to the 1.X server
  • Require at least Runit 1.2.0 cookbook to ensure compatibility with RHEL systems

v2.8.0 (2016-05-19)

  • Try a compatible package for unsupported platforms.

v2.7.0 (2016-05-18)

  • Allow installing push client 2.0 stable release

v2.6.6 (2016-04-28)

  • Fixed client key entry in config.
  • Removed node name from the push-jobs-client.rb template
  • Updated readme to properly list the supported / tested platforms

v2.6.5 (2016-04-27)

  • Update chef-ingredient version to install from packages.chef.io.

v2.6.4 (2015-11-20)

  • Fix version_from_manifest helper method.

v2.6.3 (2015-11-10)

  • Stopped the windows service from restarting with every CCR.

v2.6.2 (2015-11-04)

  • Added an attribute so we can enable timestamps on Windows.
  • Fix pushy client service registration on Windows to correctly read config file.

v2.6.1 (2015-10-21)

  • # 56 - Replaced symbols with strings in recipe

v2.6.0 (2015-10-13)

  • Use chefdk version of berks for travis.
  • # 54 Unbreak chef-ingredient installs, and improve version

independence logic.

v2.5.0 (2015-10-06)

  • 53 - Allow node_name and chef_server_url to be overridden

  • 49 - Support the name changes in 1.3x and 2.0 push client,

especially on windows

  • 52 - More updates for newer rubocop and foodcritic

  • 50 - Allow ssl to be disabled

  • Cleanups for travis testing and general hygiene

    • test on modern ruby
    • update kitchen.yml boxes
    • bump gem versions
    • rubocop update, use standard rules, misc fixes
    • foodcritic fixes
    • update README CONTRIBUTING
    • update urls/emails

v2.4.2 (2015-09-08)

  • 42 - Windows push client to use own config

  • 43 - Include version in package name for idempotency

  • 46 - debug flag to logging level flag

v2.4.1 (2015-07-29)

  • # 41 - fix client path and node_name

v2.4.0 (2015-07-20)

  • Using chef-ingredient
  • service_container recipe

v2.3.0 (2015-06-18)

  • Support environment variables in config file
  • Correctly generate the chef client config.rb path on windows boxes.
  • Greatly improved README

v2.2.1 (2014-07-09)

  • Refactored the service creation in the same manner as chef-client cookbook.
  • Changed up the kitchen file to remove CentOS 5.9 and switched out Ubuntu 10.04 for Ubuntu 14.04.

v2.2.0 (2014-03-07)

  • Move config and service resources to separate recipes
  • Add new helper methods for config path
  • Update ChefSpec to v3 and specs to match

v2.0.1 (2014-02-20)

  • Make whitelist rendering is more robust
  • Ensure node['push_jobs']['whitelist'] is a Hash (or subclass thereof)

v2.0.0 (2014-02-18)

  • node['push_jobs']['package_url'] and node['push_jobs']['package_checksum'] are now required when installing the client package. The previous version of this cookbook automatically determined the proper values for the node if values were not supplied.

v1.0.0 (2013-10-28)

  • Initial release

Collaborator Number Metric
            

4.0.2 passed this metric

Contributing File Metric
            

4.0.2 passed this metric

Foodcritic Metric
            

4.0.2 failed this metric

FC016: LWRP does not declare a default action: push-jobs/resources/service_runit.rb:1
FC016: LWRP does not declare a default action: push-jobs/resources/service_systemd.rb:1
FC016: LWRP does not declare a default action: push-jobs/resources/service_upstart.rb:1
Run with Foodcritic Version 10.3.1 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

License Metric
            

4.0.2 passed this metric

No Binaries Metric
            

4.0.2 passed this metric

Testing File Metric
            

4.0.2 passed this metric

Version Tag Metric
            

4.0.2 passed this metric