Skip to main content

Testing with Test Kitchen

  • Chapter
  • First Online:
Ansible
  • 2413 Accesses

Abstract

You’ve come a long way since you first started writing Ansible playbooks, but your workflow so far is missing something. You currently write a playbook, run it against a Vagrant machine, and then log in and inspect the results by hand. While this works, it’s not foolproof, and it definitely doesn’t scale once you start working with more than a handful of servers. Writing tests for playbooks is a good idea, as it means that you can prove that the playbook does what you expect it to do. In this chapter, we’re going to take a look at a tool named Test Kitchen, or Kitchen, for short. Using Kitchen, you specify a playbook to run and the expected state of a system after it runs, and then have Kitchen automatically test that your expectations are met. Once you have these tests in place, you can safely change your playbooks without worrying about introducing any regressions.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Michael Heap

About this chapter

Cite this chapter

Heap, M. (2016). Testing with Test Kitchen. In: Ansible. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-1659-0_8

Download citation

Publish with us

Policies and ethics