From the course: Ansible: From Basics to Guru by Pearson

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Lesson 11 lab solution: Optimizing Ansible

Lesson 11 lab solution: Optimizing Ansible - Ansible Tutorial

From the course: Ansible: From Basics to Guru by Pearson

Lesson 11 lab solution: Optimizing Ansible

So we need a dedicated project directory, let's call it lab10. And in lab10, I'm going to create an Ansible.cfg. from scratch. No need to create the Ansible.cfg So let's start from the example that we've been using throughout. And in this example, I'm adding SSH connection. adding SSH connection. Where we want to have SSH args is minus O control master is auto and minus O control persist is 120 seconds. And also we want to set pipelining is true. Good, that is one part. Then we need the inventory. So, creating an inventory with just Ansible 1. Let's just start with one host to do the appropriate testing. And next, we need some line-in-file. So, what are we going to do in line-in-file? Well, we need to make sure that we have the appropriate parameters in the sudo configuration. Let's create change-sudo.yml And in change-sudo.yml I need name change-sudo-config It's a typo, let's fix that. Hosts all and tasks. Well, the tasks that is basically the line in file. changing the file and…

Contents