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.

Using Ansible to configure managed nodes, part 3

Using Ansible to configure managed nodes, part 3 - Ansible Tutorial

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

Using Ansible to configure managed nodes, part 3

There's a third part in this demo. Let me show the slide and then let's continue. So now we need to verify that it is working and in order to do so, I'm using ansible minus i inventory. Let's go over these options again. Minus i inventory is telling the ansible command where it can find the inventory file. I want to connect as user ansible-k. That is prompting for the ssh password. Minus m command. And the command that I want to run this time is whoami. That's a very simple command. And as you can see on ansible1, I'm user ansible. On ansible2, I'm user ansible. Let's make a slight modification. And let's do an ls-l on slash root. What do you think? Is that going to work? work? Well, we will find out in a few seconds. Oh, no, permission denied. Of course, that's not going to work because we haven't set up any privilege escalation for this Ansible user. So privilege escalation, what is that? Well, that is sudo. Let's take care of sudo using ansible-i inventory, all-m copy. And what am…

Contents