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

RSS

windows_print (5) Versions 2.1.1

Installs/Configures print

Policyfile
Berkshelf
Knife
cookbook 'windows_print', '= 2.1.1', :supermarket
cookbook 'windows_print', '= 2.1.1'
knife supermarket install windows_print
knife supermarket download windows_print
README
Dependencies
Changelog
Quality 33%

windows_print Cookbook

This cookbook installs Windows Print and Document Services, handles driver, port, and printer installation.

Requirements

Platform

  • Windows Server 2012+

Cookbooks

  • none

Usage

windows_print::default

The windows_print::default recipe installs the required roles and features to support a windows print server.

Includes the Print Management snap-in, which is used for managing multiple printers or print servers and migrating printers to and from other Windows print servers.

{
  "name":"my_node",
  "run_list": [
    "recipe[windows_print]"
  ]
}

windows_print::distributed_scan_server

The windows_print::distributed_scan_server recipe installs the required roles and features to install a distributed scan server.

Provides the service which receives scanned documents from network scanners and routes them to the correct destinations. It also includes the Scan Management snap-in, which you can use to manage network scanners and configure scan processes.

This feature is only available for server 2012r2 and server 2016 and domain membership is required.

{
  "name":"my_node",
  "run_list": [
    "recipe[windows_print::distributed_scan_server]"
  ]
}

windows_print::internet_printing

The windows_print::internet_printing recipe installs the required roles and features to install internet printing.

Creates a Web site where users can manage print jobs on the server. It also enables users who have Internet Printing Client installed to use a Web browser to connect and print to shared printers on the server by using the Internet Printing Protocol (IPP).

{
  "name":"my_node",
  "run_list": [
    "recipe[windows_print::internet_printing]"
  ]
}

windows_print::lpd_service

The windows_print::lpd_service recipe installs the required roles and features to install LPD Service.

Line Printer Daemon (LPD) Service enables UNIX-based computers or other computers using the Line Printer Remote (LPR) service to print to shared printers on this server.

{
  "name":"my_node",
  "run_list": [
    "recipe[windows_print::lpd_service]"
  ]
}

Resource/Provider

driver

Installs printer driver from inf file.

Actions

  • :install: Installs a printer driver
  • :delete: Removes a printer driver

Property Parameters

  • driver_name: name property. Name of the print driver.
  • inf_path: Full path to the inf file.
  • inf_file: Name of the inf file.
  • version: Default "Type 3 - User Mode" Options: "Type 3 - User Mode" or "Type 2 - Kernel Mode"
  • environment: Chipset of the driver being installed. Default "x64" Options: "x86", "x64" or "Itanium".
  • domain_username: Domain username to allow mapping network drive for driver installation.
  • domain_password: Password for domain username.

Examples

    # Install HP LaserJet 9050 PS driver
    windows_print_driver 'HP LaserJet 9050 PS' do
      action :install
      inf_path 'c:\\9050 x64'
      inf_file 'hpc9050v.inf'
    end

    # Install HP LaserJet 9050 PS driver from network location
    windows_print_driver 'HP LaserJet 9050 PS' do
      action :install
      inf_path '\\Network Share\\print drivers\\9050 x64'
      inf_file 'hpc9050v.inf'
      domain_username 'Chef'
      domain_password 'Password'
    end

    # Delete HP LaserJet 9050 PS driver
    windows_print_driver 'HP LaserJet 9050 PS' do
      action :delete
    end

'printer'

Allows creation of printer objects. Handles port and driver creation if not present.

Actions

  • :create: Creates a printer
  • :delete: Deletes a printer

Property Parameters

  • printer_name: name property. Name of the printer. Required
  • driver_name: Name of the print driver. Required
  • ports: Name of the port and IPv4 address. Required
  • share_name: Shared printer object name.
  • location: Location field for printer object.
  • comment: Comments section for printer object.
  • inf_path: Full path to the inf file.
  • inf_file: Name of the inf file.
  • version: Default "Type 3 - User Mode" Options: "Type 3 - User Mode" or "Type 2 - Kernel Mode"
  • environment: Chipset of the driver being installed. Default "x64" Options: "x86", "x64" or "Itanium".
  • domain_username: Domain username to allow mapping network drive for driver installation.
  • domain_password: Password for domain username.

Examples

    # Create HP LaserJet
    windows_print_printer 'HP LaserJet' do
      action :create
      driver_name 'HP LaserJet'
      port_name 'HP LaserJet'
    end

    # Create HP LaserJet, create driver, create port
    windows_print_printer 'HP LaserJet' do
      action :create
      driver_name 'HP LaserJet'
      ports ({ "HP LaserJet" => "10.0.0.50" })
      inf_path 'C:\\chef\\cookbooks\\windows_print\\files\\default\\HP Universal Printing PCL 6 (v5.4)\\x64'
      inf_file 'hpcu118u.inf'
      environment 'x64'
    end

    # Create HP LaserJet and share as 'HP Printer'
    windows_print_printer 'HP LaserJet' do
      action :create
      driver_name 'HP LaserJet'
      ports ({ "HP LaserJet" => "10.0.0.50" })
      comment ''
      inf_path 'C:\\chef\\cookbooks\\windows_print\\files\\default\\HP Universal Printing PCL 6 (v5.4)\\x64'
      inf_file 'hpcu118u.inf'
      share_name 'HP Printer'
      environment 'x64'
    end

    # Create HP LaserJet with multiple ports
    windows_print_printer 'HP LaserJet' do
      action :create
      driver_name 'HP LaserJet'
      ports ({ "HP LaserJet" => "10.0.0.50",
               "HP ColorLaserJet" => "10.0.0.51"
             })
      comment ''
      inf_path 'C:\\chef\\cookbooks\\windows_print\\files\\default\\HP Universal Printing PCL 6 (v5.4)\\x64'
      inf_file 'hpcu118u.inf'
      share_name 'HP Printer'
      environment 'x64'
    end

    # Deletes HP LaserJet
    windows_print_port 'HP LaserJet' do
      action :delete
    end

'printer_settings'

Creates and restores printer settings (Printing Defaults) from binary file.

Actions

  • :create: Creates a bin file to store settings.
  • :restore: Uses previously created bin file to restore settings.

Property Parameters

  • printer_name: Name of the printer.
  • path: Full path to settings file.
  • file: File name to store settings to.
  • domain_username: Domain username to allow mapping network drive for driver installation.
  • domain_password: Password for domain username.

Examples

    # Create settings file for 'HP LaserJet'
    windows_print_printer_settings 'HP Laserjet' do
      path '\\\\<server>\\<share>'
      file 'HP LaserJet.bin'
      action: create
      domain_username 'Chef'
      domain_password 'Password'
    end

    # Restore settings file for 'HP LaserJet'
    windows_print_printer_settings 'HP Laserjet' do
      path '\\\\<server>\\<share>'
      file 'HP LaserJet.bin'
      action: restore
      domain_username 'Chef'
      domain_password 'Password'
    end

'port'

Allows creation of ports based on name rather than IP Address.

Actions

  • :create: Installs a printer port
  • :delete: Removes a printer port

Property Parameters

  • port_name: name property. Name of the port.
  • ipv4_address: IPv4 address of the printer port
  • ports: Name of the port and IPv4 address.

Examples

    # Install PrinterPort1 port @ 10.0.0.50
    windows_print_port 'PrinterPort1' do
      action :create
      ipv4_address '10.0.0.50'
    end

    # Deletes PrinterPort1 port
    windows_print_port 'PrinterPort1' do
      action :delete
    end

Example Recipes

windows_print::create_printer_settings_data_bag

The test_windows_print::create_printer_settings_data_bag will create bin files containing the current printer defaults. These must be manually changed through Print Management. Assumes printer data bag item is labelled printers. See .\test\fixtures\data_bags for sample data bag example.

{
  "name":"my_node",
  "run_list": [
    "recipe[test_windows_print::create_printers_settings_data_bag]"
  ]
}

windows_print::create_printers_data_bag

The test_windows_print::create_printers_data_bag will install the driver, create the port, and printer for each data bag item. Assumes printer data bag item is labelled printers. See .\test\fixtures\data_bags for sample data bag example.

{
  "name":"my_node",
  "run_list": [
    "recipe[test_windows_print::create_printers_data_bag]"
  ]
}

windows_print::delete_printers_data_bag

The test_windows_print::delete_printers_data_bag will remove the port and printer for each data bag item. The driver is not touched as there is no current method to detect if the driver is still in use. Assumes printer data bag item is labelled printers_del. See .\test\fixtures\data_bags for sample data bag example.

{
  "name":"my_node",
  "run_list": [
    "recipe[test_windows_print::delete_printers_data_bag]"
  ]
}

windows_print::restore_printer_settings_data_bag

The test_windows_print::restore_printer_settings_data_bag will restore bin files containing the printer defaults.

{
  "name":"my_node",
  "run_list": [
    "recipe[test_windows_print::printer_settings_data_bag]"
  ]
}

Example Data Bags

printer_defaults

Example binary file created from create_printer_settings_data_bag and used to restore settings using restore_printer_settings_data_bag.

printers/printers_del

Example data bag for using data_bags to manage printer objects. inf_file will contain the driver_name value.

{
  "id": "HP-LaserJet-9050",
  "printer_name": "HP-LaserJet-9050",
  "share_name": "HP-LaserJet-9050",
  "inf_path": "\\\\fileserver\\Print Drivers\\HP Universal Printing PCL 6 (v5.4)\\x64",
  "inf_file": "hpcu118u.inf",
  "comment": "",
  "location": "",
  "driver_name": "HP Universal Printing PCL 6 (v5.4)",
  "ports": { "HP-LaserJet-9050" : "192.168.1.100" },
  "environment": "x64",
  "domain_username": "admin",
  "domain_password": "Password",
  "path": "c:\\chef\\cache\\windows_print\\files\\printer_defaults",
  "file": "HP-LaserJet-9050.bin"
}

Contributing

  1. Fork the repository on Github
  2. Create a named feature branch (like add_component_x)
  3. Write you change
  4. Write tests for your change (if applicable)
  5. Run the tests, ensuring they all pass
  6. Submit a Pull Request using Github

License and Authors

Authors:: Derek Groh (dgroh@arch.tamu.edu)

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

CHANGELOG for print

This file is used to list changes made in each version of print.

2.1.1 - 2024-05-03

2.1.0 - 2023-10-31

  • Update CI permissions
  • Change LICENSE to Apache-2.0

2.0.1 - 2023-10-03

  • Standardise files with files in sous-chefs/repo-management
  • Transfer ownership to sous-chefs
  • Remove Map Network drive for driver and printer resources.

2.0.0

  • Providers removed in favor of resources
  • Restructured cookbook - move sample files into test.
  • Test kitchen support
  • Delivery support
  • Github Issues

1.0.2

  • Skip restore settings if the file does not exist

1.0.0

  • Support for data bag items with recipes to create and delete printer objects and printer settings.

0.9.0

  • Changelog has been ignored for sometime.
    • Current features: Add, remove ports, printers, drivers
    • Create and restore printer defaults.

0.1.0

  • Initial release of windows_print

Collaborator Number Metric
            

2.1.1 failed this metric

Failure: Cookbook has 1 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric
            

2.1.1 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file

Cookstyle Metric
            

2.1.1 passed this metric

No Binaries Metric
            

2.1.1 passed this metric

Testing File Metric
            

2.1.1 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file

Version Tag Metric
            

2.1.1 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number