Collaboration in DevOps

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor DeployView Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.

DeployView Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, DeployView Publishing cannot guarantee the accuracy of this information.

First published: 2024


Published by

DeployView Publishing

Birmingham, United Kingdom

ISBN 978-1-3999-8635-9

Dedicated to

My wife and my daughter.

Acknowledgement

I’d like to express my gratitude to everyone who has shown me unconditional love and encouragement throughout my personal and professional life. Your support was crucial to the completion of this book. I appreciate your help with this endeavour and your continued interest in my career.

About the Author

Shafiq Alibhai is a developer who has worked in web development and devops for companies with anywhere between one to thousands of servers. He also manages many virtual servers for services offered by DeployView Limited and has been using Ansible to manage infrastructure since 2016.

Disclaimer

Any opinions or personal views I express in this book are my own and not those of Red Hat Inc.

Ansible®, Red Hat® Ansible® Automation Platform, Red Hat®, JBoss®, OpenShift®, Fedora®, Hibernate®, CloudForms®, RHCA®, RHCE®, RHCSA®, Ceph®, Gluster®, the Red Hat® logo and “A” logo in a shaded circle are trademarks or registered trademarks of Red Hat, Inc. or its subsidiaries in the United States and other countries. https://www.redhat.com/en/about/brand/standards/trademarks

Linux is a registered trademark of Linus Torvalds.

Certified Kubernetes®, Certified Kubernetes Administrator®, Certified Kubernetes Application Developer®, Certified Kubernetes Security Specialist®, CloudEvents®, CloudNativeCon®, CNCF®, containerd®, etcd®, KubeCon®, Kubernetes®, LSB®, Open Container Initiative®, Prometheus®, The Linux Foundation®, Xen Project®, Cloud Native Computing Foundation logo, Kubernetes and Cloud Native Associate and Design (color), OpenTelemetry and Design (black and white), Fluentd and Design of a Carrier Pigeon (color - horizontal) are registered trademarks of The Linux Foundation in the United States and/or other countries. The marks CRI-O™, LF™, LinuxCon™, Linux Foundation™, OpenGitOps™, OpenTelemetry™, Open Container Format™, Open Virtualization Alliance™, Virtual Kubelet™, World of Open Source™ have registrations pending or trademarks in use of The Linux Foundation in the United States and/or other countries. The Linux Foundation logo. US Reg. no. 5166331 (The Linux Foundation geometric design (black and white)), The Linux Foundation logo. US Reg. no. 5166330 (The Linux Foundation geometric design (color)), Certified Kubernetes logo. US Reg. no. 5734733, Community Data License Agreement logo. US Reg. no. 5852265, fluentd logo. US Reg. no. 4734498, Kubernetes logo. US Reg. no. 4816320, Kubernetes and Cloud Native Associate and Design (color) US Reg. 6949718, SupplyChainSecurity and Design (black and white) US Reg. No. 6949717 are registered trademarks for the following logo marks in the United States and/or other countries. https://www.linuxfoundation.org/trademark-usage/

UNIX® is a registered trademark of The Open Group.

Python, PyCon, PyLadies, and Python logos (in several variants) are registered trademarks of the Python Software Foundation. https://www.python.org/psf/trademarks/

Azure, Microsoft®, Microsoft® 365, Microsoft Teams, PowerPoint®, Outlook®, OneDrive®, SharePoint®, The Microsoft ® Store, Windows® and Windows® 10, Windows, Vista, XP, NT are registered trademarks or trademarks of Microsoft Corporation in the U.S.A. and other countries. https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks

Apple, Mac, Mac OS, Macintosh, Pages, and TrueType are either registered trademarks or trademarks of Apple Computer, Inc. in the United States and/or other countries. https://www.apple.com/legal/intellectual-property/trademark/appletmlist.html

IBM is a registered trademark of International Business Machines Corporation. https://www.ibm.com/legal/us/en/copytrade.shtml

Celeron, Celeron Inside, Centrino, Centrino logo, Core Inside, Intel Core, Intel Inside, Intel Inside logo, Itanium, Itanium Inside, Pentium, Pentium Inside, VTune, Xeon, and Xeon Inside are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries. https://www.intel.com/content/www/us/en/legal/trademarks.html

Amazon Web Services, AWS, the Powered by AWS logo, and any other AWS Marks used in this book are trademarks of Amazon.com, Inc. or its affiliates. This book is not endorsed by or affiliated with Amazon in any way https://aws.amazon.com/trademark-guidelines/

Google, Chrome™ browser, Chromium™ open source project, Cloud TPU™ integrated circuit, GCP™ infrastructure platform, GKE™ software service, Gmail™ email service, Google App Engine™ platform, Google Cloud Platform™ service, Google Cloud Storage™ service, Google Cloud™ enterprise services, Google Compute Engine™ service, Google Container Engine™ container management system, Google Dashboard™ interface, Google Photos™ photo storage and organizing platform, Google™ search or search engine, Go™ programming language, Kubeflow™ open-source machine learning platform, Optimized Chip™ processor chip, SPDY™ protocol, YouTube™ video community, are trademarks of Google LLC and this book is not endorsed by or affiliated with Google in any way. https://about.google/brand-resource-center/

HashiCorp®, Vagrant, Packer, Terraform, HashiCorp products, name & logo are trademarks of The HashiCorp, Inc. https://www.hashicorp.com/trademark-policy

All other trademarks are the property of their respective owners.

Preface

tbc

Who is this book for?

tbc

Development Environment

The code provided in this book is compatible with any text editor or integrated development environment (IDE). An IDE is a software tool that offers comprehensive features for software development, such as code editing, debugging, compilation, and project management.

The base environment for reproducing the code examples of this book:

A text editor: graphical (VS Code, Atom, Geany, etc.) or terminal (VIM, Emacs, Nano, Pico, etc.). A workstation with either the ansible or ansible-core installed packages. We recommend using Visual Studio Code as the preferred IDE, which can be freely downloaded at https://code.visualstudio.com.

Conventions Used in the Book

Throughout the book, we encounter numerous examples and terminal commands. The Ansible language primarily utilizes YAML and INI formats for syntax. When not specified in the text, assume the file format is YAML. The code adheres to the latest YAML specification. YAML, known for its simplicity, readability, and broad compatibility with programming languages, allows for a concise representation of complex data structures. It is widely used for configuration files and data exchange, similar to JSON but with Python-style indentation and a more compact format for lists and dictionary statements.

The INI format is frequently used for inventory and the Ansible configuration file. It is a straightforward configuration file format utilizing key-value pairs and sections for storing settings and preferences in a human-readable manner.

Many terminal commands are standard Linux commands, indicated inline (e.g., ansible [command]) or in a code block (with or without line numbers). For instance:

$ echo Hello World

The provided terminal commands follow POSIX conventions and are compatible with Unix-like systems, including Linux, macOS, and BSD. Each command assumes usage by a standard user account when prefixed with the $ (dollar) symbol or by the root user when prefixed with the # (number sign) symbol.

Each Ansible resource (playbook, role, plugin, and collection) adheres to the latest Ansible best practices, validated with the latest release of the Ansible Linter.

However, it’s worth noting that specific code snippets intentionally diverge from best practices to reproduce specific behaviors or use cases accurately. This ensures a comprehensive understanding of Ansible, encompassing ideal techniques and real-world scenarios.

Code Bundle and Coloured Images

Please follow the link to download the

Code Bundle and the Coloured Images of the book: https://github.com/deployview/Ansible-for-Windows

The code bundle for the book is also hosted on GitHub at https://github.com/deployview/Ansible-for-Windows. In case there’s an update to the code, it will be updated on the existing GitHub repository. We have code bundles from our rich catalogue of books and videos available at https://github.com/deployview. Check them out!

Please help improve this book!

We take immense pride in our work at DeployView Publishing and follow best practices to ensure the accuracy of our content to provide with an indulging reading experience to our subscribers. Our readers are our mirrors, and we use their inputs to reflect and improve upon human errors, if any, that may have occurred during the publishing processes involved. To let us maintain the quality and help us reach out to any readers who might be having difficulties due to any unforeseen errors, please write to us at : errata@deployview.com Your support, suggestions and feedbacks are highly appreciated by us.

New revisions of this book are published on a regular basis (see current book publication stats below). If you think a particular section needs improvement or find something missing, please post an issue in the Ansible for Windows issue queue (on GitHub) or contact me via Twitter (@deployview). All known issues with Ansible for Windows will be aggregated on the book’s online Errata page. Current Published Book Version Information • Current book version: 1.0 • Current Ansible version as of last publication: 9.6.0 (core 2.16.7) • Current Date as of last publication: June 17, 2024

Piracy

If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at business@deployview.com with a link to the material.

Reviews

Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions. We at DeployView Publishing can understand what you think about our products, and our authors can see your feedback on their book. Thank you!

Join our book’s Discord space

Join the book’s Discord Workspace for Latest updates, Offers, Tech happenings around the world, New Release and Sessions with the Authors:

https://discord.deployview.com.com

Introduction