Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Puppet 5 Cookbook
Puppet 5 Cookbook

Puppet 5 Cookbook: Jump start your Puppet 5.x deployment using engaging and practical recipes , Fourth Edition

Arrow left icon
Profile Icon Thomas Uphill
Arrow right icon
NZ$71.99
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.7 (3 Ratings)
Paperback Jun 2018 394 pages 4th Edition
eBook
NZ$14.99 NZ$57.99
Paperback
NZ$71.99
Subscription
Free Trial
Arrow left icon
Profile Icon Thomas Uphill
Arrow right icon
NZ$71.99
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.7 (3 Ratings)
Paperback Jun 2018 394 pages 4th Edition
eBook
NZ$14.99 NZ$57.99
Paperback
NZ$71.99
Subscription
Free Trial
eBook
NZ$14.99 NZ$57.99
Paperback
NZ$71.99
Subscription
Free Trial

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

Puppet 5 Cookbook

Puppet Infrastructure

We will cover the following recipes in this chapter:

  • Managing your manifests with Git
  • Creating a decentralized Puppet architecture
  • Writing a papply script
  • Running Puppet from cron
  • Bootstrapping Puppet with Bash
  • Creating a centralized Puppet infrastructure
  • Creating certificates with multiple DNS names
  • Setting up the environment
  • Configuring PuppetDB
  • Configuring Hiera
  • Environment-specific Hiera
  • Setting node-specific data with Hiera
  • Writing a Custom Hiera 5 function
  • Storing secret data with hiera-eyaml
  • Automatic syntax-checking with Git hooks 
  • Pushing code around with Git
  • Managing environments with Git

Introduction

In this chapter, we will cover how to deploy Puppet in a centralized and decentralized manner. With each approach, we'll see a combination of best practices, my personal experience, and community solutions. We'll configure and use both PuppetDB and Hiera. PuppetDB is used with exported resources, which we will cover in Chapter 5, Users and Virtual Resources. Hiera is used to separate variable data from Puppet code. Finally, we will learn about Git and see how to use Git to organize our code and our infrastructure. Because Linux distributions, such as Ubuntu, Red Hat, and CentOS, differ in the specific details of package names, configuration file paths, and many other things, for reasons of space and clarity, the best approach for this book is was pick one distribution (CentOS 7) and stick to that. However, Puppet runs on most popular operating systems, so...

Managing your manifests with Git

It's a great idea to put your Puppet manifests in a version-control system, such as Git or Subversion (Git is the de facto standard for Puppet). This gives you several advantages:

  • You can undo changes and revert to any previous version of your manifest
  • You can experiment with new features using a branch
  • If several people need to make changes to the manifests, they can make them independently, in their own working copies, and then merge their changes later
  • You can use the Git log feature to see what was changed and when (and by whom)

Getting ready

In this section, we'll import your existing manifest files into Git. If you have created a Puppet directory in a previous section, use...

Creating a decentralized Puppet architecture

Puppet is a configuration management tool that can be used to configure and prevent configuration drift in a large number of client computers. If all your client computers are easily reached via a central location, you may choose to have a central Puppet server control all the client computers. In the centralized model, the Puppet server is known as the Puppet master. Originally, the Puppet master ran a service named master, it now runs a service named puppetserver, but the name has remained. We will cover how to configure a central Puppet master later.

If your client computers are widely distributed or you cannot guarantee communication between client computers and a central location, then a decentralized architecture may be a good fit for your deployment. In the next few sections, we will see how to configure a decentralized Puppet...

Writing a papply script

We'd like to make it as quick and easy as possible to apply Puppet on a machine; for this, we'll write a short script that wraps the puppet apply command with the parameters it needs. We'll deploy the script where it's needed, with Puppet itself.

How to do it...

Follow these steps to create the papply script.

  1. In your Puppet repo, create the directories needed for a Puppet module:
t@mylaptop ~$ cd puppet/modules
t@mylaptop modules$ mkdir -p puppet/{manifests,files}
  1. Create the modules/puppet/files/papply.sh file with the following contents:
#!/bin/sh 
cd /usr/local/git/cookbook
sudo -u git git pull -q origin master
sudo /opt/puppetlabs/bin/puppet apply /usr/local/git/cookbook/manifests...

Running Puppet from cron

You can do a lot with the setup you already have: work on your Puppet manifests as a team, communicate changes via a central Git repository, and manually apply them on a machine using the papply script.

However, you still have to log in to each machine to update the Git repo and rerun Puppet. It would be helpful to have each machine update itself and apply any changes automatically. Then, all you need to do is push a change to the repo, and it will go out to all your machines within a certain time.

The simplest way to do this is with a cron job that pulls updates from the repo at regular intervals and then runs Puppet if anything has changed. Since our papply script already pulls the latest changes, we can just schedule cron to run the papply script.

Getting...

Bootstrapping Puppet with bash

Previous versions of this book used Rakefiles to bootstrap Puppet. The problem with using Rake to configure a node is that you are running the commands from your laptop; you assume you already have ssh access to the machine. Most bootstrap processes work by issuing an easy-to-remember command from a node once it has been provisioned. In this section, we'll show you how to use bash to bootstrap Puppet with a web server and a bootstrap script.

Getting ready

Install httpd on a centrally accessible server and create a password-protected area to store the bootstrap script. In my example, I'll use the Git server I set up previously, git.example.com. Start by creating a directory in the root...

Creating a centralized Puppet infrastructure

A configuration management tool such as Puppet is best used when you have many machines to manage. If all the machines can reach a central location, using a centralized Puppet infrastructure might be a good solution. Unfortunately, Puppet doesn't scale well with a large number of nodes. If your deployment has less than 4,000 servers, a single Puppet master should be able to handle the load, assuming your catalogs are not complex (take less than 10 seconds to compile each catalog). If you have a larger number of nodes, I suggest a load-balancing configuration, described in Mastering Puppet.

A Puppet master is a Puppet server that acts as an X509 certificate authority for Puppet and distributes catalogs (compiled manifests) to client nodes. The puppet master runs the puppetserver service. Puppetserver is a JRuby application running...

Creating certificates with multiple DNS names

By default, Puppet will create an SSL certificate for your Puppet master that contains the fully-qualified domain name of the server only. Depending on how your network is configured, it can be useful for the server to be known by other names. In this recipe, we'll make a new certificate for our Puppet master that has multiple DNS names.

Getting ready

Install the Puppet master package if you haven't already done so. You will then need to start the Puppet master service at least once to create a certificate authority (CA).

How to do it...

...

Introduction


In this chapter, we will cover how to deploy Puppet in a centralized and decentralized manner. With each approach, we'll see a combination of best practices, my personal experience, and community solutions. We'll configure and use both PuppetDB and Hiera. PuppetDB is used with exported resources, which we will cover in Chapter 5, Users and Virtual Resources. Hiera is used to separate variable data from Puppet code. Finally, we will learn about Git and see how to use Git to organize our code and our infrastructure. Because Linux distributions, such as Ubuntu, Red Hat, and CentOS, differ in the specific details of package names, configuration file paths, and many other things, for reasons of space and clarity, the best approach for this book is was pick one distribution (CentOS 7) and stick to that. However, Puppet runs on most popular operating systems, so you should have very little trouble adapting the recipes to your favorite OS and distribution. At the time of writing, Puppet...

Managing your manifests with Git


It's a great idea to put your Puppet manifests in a version-control system, such as Git or Subversion (Git is the de facto standard for Puppet). This gives you several advantages:

  • You can undo changes and revert to any previous version of your manifest
  • You can experiment with new features using a branch
  • If several people need to make changes to the manifests, they can make them independently, in their own working copies, and then merge their changes later
  • You can use the Git log feature to see what was changed and when (and by whom)

Getting ready

In this section, we'll import your existing manifest files into Git. If you have created a Puppet directory in a previous section, use that, otherwise, use your existing manifest directory.

In this example, we'll create a new Git repository on a server accessible from all our nodes. There are several steps we need to take to have our code held in a Git repository:

  1. Install Git on a central server.
  2. Create a user to run Git...

Creating a decentralized Puppet architecture


Puppet is a configuration management tool that can be used to configure and prevent configuration drift in a large number of client computers. If all your client computers are easily reached via a central location, you may choose to have a central Puppet server control all the client computers. In the centralized model, the Puppet server is known as the Puppet master. Originally, the Puppet master ran a service named master, it now runs a service named puppetserver, but the name has remained. We will cover how to configure a central Puppet master later.

If your client computers are widely distributed or you cannot guarantee communication between client computers and a central location, then a decentralized architecture may be a good fit for your deployment. In the next few sections, we will see how to configure a decentralized Puppet architecture.

As we have seen, we can run the puppet apply command directly on a manifest file to have Puppet apply...

Writing a papply script


We'd like to make it as quick and easy as possible to apply Puppet on a machine; for this, we'll write a short script that wraps the puppet apply command with the parameters it needs. We'll deploy the script where it's needed, with Puppet itself.

How to do it...

Follow these steps to create the papply script.

  1. In your Puppet repo, create the directories needed for a Puppet module:
t@mylaptop ~$ cd puppet/modules
t@mylaptop modules$ mkdir -p puppet/{manifests,files}
  1. Create the modules/puppet/files/papply.sh file with the following contents:
#!/bin/sh 
cd /usr/local/git/cookbook
sudo -u git git pull -q origin master
sudo /opt/puppetlabs/bin/puppet apply /usr/local/git/cookbook/manifests/site.pp \
  --modulepath=/usr/local/git/cookbook/modules $*
  1. Create the modules/puppet/manifests/init.pp file with the following contents:
class puppet {
  $papply = @("PAPPLY")
    #!/bin/sh
    cd /usr/local/git/cookbook
    sudo -u git git pull -q origin master
    sudo /opt/puppetlabs/bin...

Running Puppet from cron


You can do a lot with the setup you already have: work on your Puppet manifests as a team, communicate changes via a central Git repository, and manually apply them on a machine using the papply script.

However, you still have to log in to each machine to update the Git repo and rerun Puppet. It would be helpful to have each machine update itself and apply any changes automatically. Then, all you need to do is push a change to the repo, and it will go out to all your machines within a certain time.

The simplest way to do this is with a cron job that pulls updates from the repo at regular intervals and then runs Puppet if anything has changed. Since our papply script already pulls the latest changes, we can just schedule cron to run the papply script.

Getting ready

You'll need the Git repo we set up in the Managing your manifests with Git and Creating a decentralized Puppet architecture recipes, and the papply script from the Writing a papply script recipe. You'll need...

Bootstrapping Puppet with bash


Previous versions of this book used Rakefiles to bootstrap Puppet. The problem with using Rake to configure a node is that you are running the commands from your laptop; you assume you already have ssh access to the machine. Most bootstrap processes work by issuing an easy-to-remember command from a node once it has been provisioned. In this section, we'll show you how to use bash to bootstrap Puppet with a web server and a bootstrap script.

Getting ready

Install httpd on a centrally accessible server and create a password-protected area to store the bootstrap script. In my example, I'll use the Git server I set up previously, git.example.com. Start by creating a directory in the root of your web server:

root@git:~# puppet resource package apache2 ensure=installed
Notice: /Package[apache2]/ensure: created
package { 'apache2':
 ensure => '2.4.25-3+deb9u3',
}
root@git:~# cd /var/www/html
root@git:/var/www/html# mkdir bootstrap

Note

My git node is a Debian-based...

Creating a centralized Puppet infrastructure


A configuration management tool such as Puppet is best used when you have many machines to manage. If all the machines can reach a central location, using a centralized Puppet infrastructure might be a good solution. Unfortunately, Puppet doesn't scale well with a large number of nodes. If your deployment has less than 4,000 servers, a single Puppet master should be able to handle the load, assuming your catalogs are not complex (take less than 10 seconds to compile each catalog). If you have a larger number of nodes, I suggest a load-balancing configuration, described in Mastering Puppet.

A Puppet master is a Puppet server that acts as an X509 certificate authority for Puppet and distributes catalogs (compiled manifests) to client nodes. The puppet master runs the puppetserver service. Puppetserver is a JRuby application running on a custom Clojure framework known as TrapperKeeper. Many puppet services now run via Trapperkeeper and JRuby. Although...

Creating certificates with multiple DNS names


By default, Puppet will create an SSL certificate for your Puppet master that contains the fully-qualified domain name of the server only. Depending on how your network is configured, it can be useful for the server to be known by other names. In this recipe, we'll make a new certificate for our Puppet master that has multiple DNS names.

Getting ready

Install the Puppet master package if you haven't already done so. You will then need to start the Puppet master service at least once to create a certificate authority (CA).

How to do it...

The steps are as follows:

  1. Stop the running puppetserver process with the following command:
[root@puppet ~]# puppet resource service puppetserver ensure=false
Notice: /Service[puppetserver]/ensure: ensure changed 'running' to 'stopped'
service { 'puppetserver':
  ensure => 'stopped',
}
  1. Delete (clean) the current server certificate:
[root@puppet ~]# puppet cert clean puppet.example.com
Notice: Revoked certificate with...

Setting up the environment


Environments in Puppet are directories holding different versions of your Puppet manifests. Whenever a node connects to a Puppet master, it informs the Puppet master of its environment. By default, all nodes report to the production environment. This causes the Puppet master to look in the production environment for manifests. You may specify an alternate environment with the--environmentsetting when running puppet agent or by settingenvironment = newenvironmentin/etc/puppet/puppet.conf in the agent section.

Getting ready

Verify environmentpath in your installation with the following puppet config command:

[vagrant@puppet ~]$ sudo /opt/puppetlabs/bin/puppet config print environmentpath
/etc/puppetlabs/code/environments

How to do it...

The steps are as follows:

  1. Create a production directory at /etc/puppetlabs/code/environments that contains both a modules and manifests directory. Then, create a site.pp that creates a file in /tmp, as follows:
[vagrant@puppet ~]$ sudo mkdir...

Configuring PuppetDB


PuppetDB is a database for Puppet that is used to store information about nodes connected to a Puppet master. PuppetDB is also a storage area for exported resources. Exported resources are resources that are defined on nodes but applied to other nodes. The simplest way to install PuppetDB is to use the PuppetDB module from Puppet labs. From this point on, we'll assume you are using the puppet.example.com machine running puppetserver.

Getting ready

Install the PuppetDB module in the production environment you created in the previous recipe. If you didn't create directory environments, don't worry; using puppet module install will install the module to the correct location for your installation with the following command:

[vagrant@puppet ~]$ sudo /opt/puppetlabs/bin/puppet module install puppetlabs-puppetdb
Notice: Preparing to install into /etc/puppetlabs/code/environments/production/modules ...
Notice: Downloading from https://forgeapi.puppet.com ...
Notice: Installing...
Left arrow icon Right arrow icon

Key benefits

  • Grasp recipes that work with centralized and decentralized deployments
  • Explore language differences and enhancements anticipated in Puppet version 5.x
  • Gain expert understanding of Puppet's latest and most advanced features

Description

Puppet is a configuration management system that automates all your IT configurations, giving you control of managing each node. Puppet 5 Cookbook will take you through Puppet's latest and most advanced features, including Docker containers, Hiera, and AWS Cloud Orchestration. Updated with the latest advancements and best practices, this book delves into various aspects of writing good Puppet code, which includes using Puppet community style, checking your manifests with puppet-lint, and learning community best practices with an emphasis on real-world implementation. You will learn to set up, install, and create your first manifests with version control, and also learn about various sysadmin tasks, including managing configuration files, using Augeas, and generating files from snippets and templates. As the book progresses, you'll explore virtual resources and use Puppet's resource scheduling and auditing features. In the concluding chapters, you'll walk through managing applications and writing your own resource types, providers, and external node classifiers. By the end of this book, you will have learned to report, log, and debug your system.

Who is this book for?

Puppet 5 Cookbook is for anyone who builds and administers servers, especially in a web operations context. You’ll need some experience of Linux systems administration, including familiarity with the command line, filesystem, and text editing. No prior programming experience is required.

What you will learn

  • Discover the latest and most advanced features of Puppet
  • Master techniques to deal with centralized and decentralized Puppet deployments
  • Use exported resources and forge modules to configure and deploy applications
  • Create efficient manifests to streamline your deployments
  • Automate deployment of puppet environment using git-hooks
  • Deploy AWS instances and Docker containers with Puppet
  • Make Puppet reliable, performant, and scalable
Estimated delivery fee Deliver to New Zealand

Standard delivery 10 - 13 business days

NZ$20.95

Premium delivery 5 - 8 business days

NZ$74.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jun 28, 2018
Length: 394 pages
Edition : 4th
Language : English
ISBN-13 : 9781788622448
Vendor :
Puppet
Tools :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to New Zealand

Standard delivery 10 - 13 business days

NZ$20.95

Premium delivery 5 - 8 business days

NZ$74.95
(Includes tracking information)

Product Details

Publication date : Jun 28, 2018
Length: 394 pages
Edition : 4th
Language : English
ISBN-13 : 9781788622448
Vendor :
Puppet
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just NZ$7 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just NZ$7 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total NZ$ 208.97
Puppet 5 Cookbook
NZ$71.99
Mastering Puppet 5
NZ$71.99
Puppet 5 Beginner???s Guide
NZ$64.99
Total NZ$ 208.97 Stars icon
Banner background image

Table of Contents

11 Chapters
Puppet Language and Style Chevron down icon Chevron up icon
Puppet Infrastructure Chevron down icon Chevron up icon
Writing Better Manifests Chevron down icon Chevron up icon
Working with Files and Packages Chevron down icon Chevron up icon
Users and Virtual Resources Chevron down icon Chevron up icon
Managing Resources and Files Chevron down icon Chevron up icon
Managing Applications Chevron down icon Chevron up icon
Servers and Cloud Infrastructure Chevron down icon Chevron up icon
External Tools and the Puppet Ecosystem Chevron down icon Chevron up icon
Monitoring, Reporting, and Troubleshooting Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.7
(3 Ratings)
5 star 66.7%
4 star 0%
3 star 0%
2 star 0%
1 star 33.3%
Amazon Customer Oct 02, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I have rinsed this book and thoroughly tested most of the more complex examples and they are bang on the money. The book is excellent, and well written. My only suggestion is they should recommend using the gem yaml-lint as a tool to help debug your own hiera yaml files.
Amazon Verified review Amazon
Motley Sep 15, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book is great for people new to Puppet as it starts out simple enough for you to grasp the concepts and start learning Puppet. It will certainly not make you an expert in Puppet but it is a great start in becoming one. This book is also good for those that have used Puppet in the past but have not experience the new version (currently 5.x) and want to get a quick synopsis of the new features. This book will provide a great start to learning how to write Puppet code and what to do or not to do when setting up your Puppet infrastructure.It should be noted that while my review doesn't show as a"Verified Purchase" I have a copy and have read it, my copy was purchased directly from the publisher's (Packt) site rather than Amazon.
Amazon Verified review Amazon
Nwt Apr 13, 2019
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
Starting on the page after location 1624 there is a digital formatting problem where all text shows up in 2 1-5 character width columns. I am using the Kindle Cloud Reader and have tried multiple browsers. Same deal.Maybe it is a known Kindle Cloud Reader problem?
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela