Solution: Fixing Errors in the Playbook

Look at the solution to the previous exercise.

We'll cover the following
---
- name: Exercise
  hosts: all
  vars:
    myfile: "/proc/mounts"
  tasks:
   - name: Set file_content
     ansible.builtin.set_fact:
       file_content: "{{ lookup('file', myfile) }}"

   - name: Display the current mounts
     ansible.builtin.debug:
       var: file_content
Code to read the mounts file

Get hands-on with 1200+ tech skills courses.