● To copythe files from control node to remote hosts
● Attributes
○ src: Source file to be copied
○ dest: Destination directory on the remote clients
○ owner: Sets the file owner to root
○ group: Sets the file group to root
○ mode: Sets the file permissions
● Link: copy module — Ansible Documentation
Copy Module
● Execute theplaybook on control node
Command: ansible-playbook <file-name> . yml
6.
● Verify ifthe text file is copied to the directory of the remote host
Command: ls /tmp | grep sample.txt
7.
● Module toinsert, update, or remove a block of text in a file in Ansible
● Attributes
○ path: specifies the path where the file should be created
○ state: create a file
○ block: text which is added to the file
● Link: blockinfile — Ansible Documentation
Blockinfile Module