Difficulty: beginner
Estimated Time: 15 minutes

In this scenario, you'll learn how to use built-in ansible modules. We will use different modules like apt and git to write and execute playbooks.

Don’t stop now! The next scenario will only take about 10 minutes to complete.

Ansible Modules

Step 1 of 6

Step 1 - Bare Essentials Playbook

1. Now, tell Ansible to run on all available hosts by adding - hosts: all to our new playbook. After adding these lines, your playbook should now look like this:

- hosts: all

2. You'll need to add a section named tasks. Try to remember how from the lecture, but if you need help, peek ahead.

3. Inside tasks, you are going to tell Ansible to just ping your machines to make sure that you can connect to them:

- hosts: all
  tasks:
    - name: "Ping to test connection"
      ping:

4. Now, "provision" your newest changes to Ansible on the machine by executing:

ansible-playbook -i 'localhost,' -c local playbook.yml

You should see output that looks like the following:

==> default: Running provisioner: ansible...

PLAY [all]
********************************************************************

GATHERING FACTS
***************************************************************
ok: [default]

TASK: [Ping to test connection ]
*****************************************************************
ok: [default]

PLAY RECAP
********************************************************************

default         : ok=2    changed=0    unreachable=0    failed=0
playbook.yml