Solution: Ansible for Linux

Look at the solution to the previous exercise.

We'll cover the following
---
- name: exercise
  hosts: all
  vars:
    myfile: "/etc/motd"
  tasks:
  - name: creating a text file
    ansible.builtin.copy:
      dest: "{{ myfile }}"
      content: |
        Example of
        Message of the Day
      owner: "root"
      group: "root"
      mode: "0644"
Code to create the motd file

Get hands-on with 1400+ tech skills courses.