Ansible: Up and Running
by Bas Meijer , Lorin Hochstein , and Ren Moser
Copyright 2022 Bas Meijer. All rights reserved.
Printed in the United States of America.
Published by OReilly Media, Inc. , 1005 Gravenstein Highway North, Sebastopol, CA 95472.
OReilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://oreilly.com). For more information, contact our corporate/institutional sales department: 800-998-9938 or corporate@oreilly.com .
- Acquisitions Editor: John Devins
- Development Editor: Sarah Grey
- Production Editor: Kate Galloway
- Copyeditor: Charles Roumeliotis
- Proofreader: Piper Editorial Consulting, LLC
- Indexer: Ellen Troutman-Zaig
- Interior Designer: David Futato
- Cover Designer: Karen Montgomery
- Illustrator: Kate Dullea
- December 2014: First Edition
- August 2017: Second Edition
- July 2022: Third Edition
Revision History for the Third Edition
- 2022-07-12: First Release
See http://oreilly.com/catalog/errata.csp?isbn=9781098109158 for release details.
The OReilly logo is a registered trademark of OReilly Media, Inc. Ansible: Up and Running, the cover image, and related trade dress are trademarks of OReilly Media, Inc.
The views expressed in this work are those of the authors, and do not represent the publishers views. While the publisher and the authors have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the authors disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or rights.
978-1-098-10915-8
[LSI]
Preface to the Third Edition
Since the second edition of this book was published in 2017, there have been tremendous changes in the world of Ansible and Python, including several major releases. Substantial changes happened outside the project as well: for example, Red Hat, the company that backs the Ansible project, was bought by IBM. That hasnt slowed the Ansible project at all, of course: its still in active development and gaining users. The development of cloud infrastructure and containers has also changed the landscape immensely.
Weve made multiple changes in this edition, most significantly adding six new chapters that cover containers, Molecule, Ansible collections, creating images, cloud infrastructure, and CI/CD. Weve also added much more detail to other chapters, with a focus on using software engineering best practices and test frameworks to validate code and eradicate guesswork. Weve updated all the example code for compatibility with the latest Ansible, as well as everything that addresses Python dependencies. Our material was written to reflect the significant changes between 2017 and 2022. We could go on, but we hope youll dive into the text, try the code, and discover for yourself just how much Ansible continues to advance.
Conventions Used in This Book
The following typographical conventions are used in this book:
ItalicIndicates new terms, URLs, email addresses, filenames, and file extensions.
Constant width
Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, data types, environment variables, statements, and keywords.
Constant width bold
Shows commands or other text that should be typed literally by the user.
Constant width italic
Shows text that should be replaced with user-supplied values or by values determined by context.
Note
This element signifies a general note.
Warning
This element indicates a warning or caution.
Using Code Examples
Supplemental material (code examples, exercises, etc.) is available for download at https://github.com/ansiblebook.
If you have a technical question or a problem using the code examples, please send email to .
This book is here to help you get your job done. In general, if example code is offered with this book, you may use it in your programs and documentation. You do not need to contact us for permission unless youre reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing examples from OReilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your products documentation does require permission.
We appreciate, but generally do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: Ansible: Up and Running by Bas Meijer, Lorin Hochstein, and Ren Moser (OReilly). Copyright 2022 Bas Meijer, 978-1-098-10915-8.
If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at .
OReilly Online Learning
Note
For more than 40 years, OReilly Media has provided technology and business training, knowledge, and insight to help companies succeed.
Our unique network of experts and innovators share their knowledge and expertise through books, articles, and our online learning platform. OReillys online learning platform gives you on-demand access to live training courses, in-depth learning paths, interactive coding environments, and a vast collection of text and video from OReilly and 200+ other publishers. For more information, visit https://oreilly.com.
How to Contact Us
Please address comments and questions concerning this book to the publisher:
- OReilly Media, Inc.
- 1005 Gravenstein Highway North
- Sebastopol, CA 95472
- 800-998-9938 (in the United States or Canada)
- 707-829-0515 (international or local)
- 707-829-0104 (fax)
We have a web page for this book, where we list errata, examples, and any additional information. You can access this page at https://oreil.ly/ansible-3e.
Email to comment or ask technical questions about this book.
For news and information about our books and courses, visit https://oreilly.com.
Find us on LinkedIn: https://linkedin.com/company/oreilly-media.
Follow us on Twitter: https://twitter.com/oreillymedia.
Watch us on YouTube: https://youtube.com/oreillymedia.
Acknowledgments
From Lorin
Thanks to Jan-Piet Mens, Matt Jaynes, and John Jarvis for reviewing drafts of the book and providing feedback. Thanks to Isaac Saldana and Mike Rowan at SendGrid for being so supportive of this endeavor. Thanks to Michael DeHaan for creating Ansible and shepherding the community that sprang up around it, as well as for providing feedback on the book, including an explanation of why he chose to use the name