July Release Confetti
150+ New Hands-on Training in Aws, Linux, Azure
Red Hat, Devops, and More
Learn More

LiNUX Lab

Ansible Vault Lab 2

We deploy the real environment, you take the scenario-based labs on us. Hands-on, from anywhere, at any time.

Time required: 2 Hours

Scope

Use ansible-vault to manage a vault encrypted file.  Do the following tasks that build on tasks performed in lab 1.  If using a different or new server then first perform the tasks in Lab 1.

Edit an encrypted file.
Rekey an encrypted file.
View an encrypted file.
Decrypt an encrypted file.
Encrypt the file again.
Use the file in a playbook again. 

Suggested Pre Requisites

 

Standard tasks for all lab servers to set them up for self use.

 

Log into the lab server as user then sudo to the root user.

 

sudo su -

 

Install ansible with

 

yum install ansible

 

Add the local server as a local group.

 

Edit the /etc/ansible/hosts file.  Put the following at the top.

 

[local]
localhost

[single]
localhost

[databases]
localhost

[other]
localhost

[temp]
localhost

 

Save the /etc/ansible/hosts file.

 

Create an ansible user to use with the labs. 

 sudo useradd -G wheel ansible

Log out and log in as the ansible user.

Create an ssh key for your user.

 

ssh-keygen

Use the ssh-copy-id command to copy your own ssh key to your own user's authority file.

 


ssh-copy-id localhost

Use the ansible all -m ping command to test connectivity to the localhost.   You should now be ready to use the lab server.

 

 

 

Objectives

Use ansible-vault to manage a vault encrypted file.  Do the following tasks that build on tasks performed in lab 1.  If using a different or new server then first perform the tasks in Lab 1.

Edit an encrypted file.
Rekey an encrypted file.
View an encrypted file.
Decrypt an encrypted file.
Encrypt the file again.
Use the file in a playbook again. 

Overview

Use ansible-vault to manage a vault encrypted file.  Do the following tasks that build on tasks performed in lab 1.  If using a different or new server then first perform the tasks in Lab 1.

Edit an encrypted file.
Rekey an encrypted file.
View an encrypted file.
Decrypt an encrypted file.
Encrypt the file again.
Use the file in a playbook again. 

Scenarios

1. Setup Lab server as per Pre-requisites.
2. Use ansible-vault to perform the following tasks.
3. Encrypt a file.
4. Edit an encrypted file.
5. Rekey an encrypted file.
6. View an encrypted file.
7. Decrypt an encrypted file.
8. Encrypt the file again.
9. Use the file in a playbook with the decrypt option.

Share our Labs
Start Your Free Trial

We have the longest and most in depth courses about cloud and engineering topics on the web. All of our training content is included with every membership.