From the course: Learning Ansible

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Solution: Write a playbook with Ansible

Solution: Write a playbook with Ansible - Ansible Tutorial

From the course: Learning Ansible

Start my 1-month free trial

Solution: Write a playbook with Ansible

- So how did you do writing a playbook in Ansible? Let me walk you through my solution. So the first thing that I'm going to do is per the instructions note I've created a challenges directory in my home folder and I'm going to use the touch utility in order to quickly create a testone.txt and a testtwo.txt file. So if I list the files in that directory we can see we have the two files. Now I'll go over to my favorite editor and notice I've got an older playbook from our course inside here and it's always nice to go ahead and use a previous excellent playbook that you know that works beautifully as a template. So I'm going to do a file save as and I'll go ahead and save this as our challenge.yml and we'll take note that that is in my documents folder. So we have a challenge.yml file and I'll name this play in the playbook as the challenge answers and notice we'll run this against the localhost as was required.…

Contents