Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Modern DevOps Practices

You're reading from  Modern DevOps Practices

Product type Book
Published in Sep 2021
Publisher Packt
ISBN-13 9781800562387
Pages 530 pages
Edition 1st Edition
Languages
Author (1):
Gaurav Agarwal Gaurav Agarwal
Profile icon Gaurav Agarwal

Table of Contents (19) Chapters

Preface 1. Section 1: Container Fundamentals and Best Practices
2. Chapter 1: The Move to Containers 3. Chapter 2: Containerization with Docker 4. Chapter 3: Creating and Managing Container Images 5. Chapter 4: Container Orchestration with Kubernetes – Part I 6. Chapter 5: Container Orchestration with Kubernetes – Part II 7. Section 2: Delivering Containers
8. Chapter 6: Infrastructure as Code (IaC) with Terraform 9. Chapter 7: Configuration Management with Ansible 10. Chapter 8: IaC and Config Management in Action 11. Chapter 9: Containers as a Service (CaaS) and Serverless Computing for Containers 12. Chapter 10: Continuous Integration 13. Chapter 11: Continuous Deployment/Delivery with Spinnaker 14. Chapter 12: Securing the Deployment Pipeline 15. Section 3: Modern DevOps with GitOps
16. Chapter 13: Understanding DevOps with GitOps 17. Chapter 14: CI/CD Pipelines with GitOps 18. Other Books You May Enjoy

Building the Apache and MySQL images using Packer and Ansible provisioners

We will now use Packer to create the Apache and MySQL images. Before defining the Packer configuration, we have a few prerequisites to allow Packer to build custom images.

Prerequisites

We would need to create a service principal for Packer to interact with Azure and build the image.

First, log in using the Azure CLI to your Azure account using the following command:

$ az login

Now, set the subscription to the subscription id we got in response to az login using the following command:

$ az account set --subscription="<SUBSCRIPTION_ID>"

Then create the service principal with contributor access using the following command:

$ az ad sp create-for-rbac --role="Contributor" \
--scopes="/subscriptions/<SUBSCRIPTION_ID>"Creating ‘Contributor' role assignment under scope ‘/subscriptions/<SUBSCRIPTION_ID>'  Retrying...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}