--- # ============================================================================= # APPLY PLAYBOOK # Purpose: Deploy dvir.txt file to target servers at /tmp/dvir.txt # Usage: ansible-playbook apply.yml # ============================================================================= - name: Deploy file to servers hosts: all become: true tasks: # ───────────────────────────────────────────────────────────────────── # TASK 1: Copy file to destination # Copies the dvir.txt from the repo to /tmp/dvir.txt on target servers # ───────────────────────────────────────────────────────────────────── - name: Copy file to destination copy: src: ../../files/dvir.txt dest: /tmp/dvir.txt owner: root group: root mode: "0644" # ───────────────────────────────────────────────────────────────────── # TASK 2: Confirm deployment success # Displays success message with the hostname for verification # ───────────────────────────────────────────────────────────────────── - name: Confirm deployment debug: msg: "✅ File deployed successfully to /tmp/dvir.txt on {{ inventory_hostname }}"