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 now! 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
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning DevOps

You're reading from   Learning DevOps A comprehensive guide to accelerating DevOps culture adoption with Terraform, Azure DevOps, Kubernetes, and Jenkins

Arrow left icon
Product type Paperback
Published in Mar 2022
Publisher Packt
ISBN-13 9781801818964
Length 560 pages
Edition 2nd Edition
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Mikael Krief Mikael Krief
Author Profile Icon Mikael Krief
Mikael Krief
Arrow right icon
View More author details
Toc

Table of Contents (25) Chapters Close

Preface 1. Section 1: DevOps and Infrastructure as Code
2. Chapter 1: The DevOps Culture and Infrastructure as Code Practices FREE CHAPTER 3. Chapter 2: Provisioning Cloud Infrastructure with Terraform 4. Chapter 3: Using Ansible for Configuring IaaS Infrastructure 5. Chapter 4: Optimizing Infrastructure Deployment with Packer 6. Chapter 5: Authoring the Development Environment with Vagrant 7. Section 2: DevOps CI/CD Pipeline
8. Chapter 6: Managing Your Source Code with Git 9. Chapter 7: Continuous Integration and Continuous Delivery 10. Chapter 8: Deploying Infrastructure as Code with CI/CD Pipelines 11. Section 3: Containerized Microservices with Docker and Kubernetes
12. Chapter 9: Containerizing Your Application with Docker 13. Chapter 10: Managing Containers Effectively with Kubernetes 14. Section 4: Testing Your Application
15. Chapter 11: Testing APIs with Postman 16. Chapter 12: Static Code Analysis with SonarQube 17. Chapter 13: Security and Performance Tests 18. Section 5: Taking DevOps Further/More on DevOps
19. Chapter 14: Security in the DevOps Process with DevSecOps 20. Chapter 15: Reducing Deployment Downtime 21. Chapter 16: DevOps for Open Source Projects 22. Chapter 17: DevOps Best Practices 23. Assessments 24. Other Books You May Enjoy

Protecting data with Ansible Vault

So far, we've learned how to use Ansible with an inventory file that contains the list of hosts to configure, and with a playbook that contains the code of the host's configuration actions. But in all IaC tools, it will be necessary to extract some data that is specific to a context or environment inside variables.

In this section, we will look at how to use variables in Ansible and how to protect sensitive data with Ansible Vault.

To illustrate this use and protection of variables, we will complete our example by installing a MySQL server on the database server.

Let's begin by looking at the use and utility of variables in Ansible.

Using variables in Ansible for better configuration

When deploying infrastructure with IaC, the code that's used is often composed of two parts:

  • A part that describes the elements or resources that make up the infrastructure.
  • Another part that differentiates the properties...
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 $19.99/month. Cancel anytime