Exam 701-100 Topic 5 Question 33 Discussion

Actual exam question for Lpi's 701-100 exam
Question #: 33
Topic #: 5
Which Ansible modules can be used to change the contents of a file? (Choose three correct answers.)

Suggested Answer: A,B,C Vote an answer

Ansible provides several modules to manipulate the contents of files. The correct modules for changing the contents of a file are:
* lineinfile: This module ensures a particular line is present or absent in a file, or it can replace existing lines that match a pattern.
* replace: This module performs a search and replace on a string in a file.
* patch: This module applies a patch to a file. It can be used to apply diffs to files, which essentially modifies the contents based on the diff provided.
The other options, insert and modify, are not standard Ansible modules for file content manipulation.
References:
* Ansible Documentation - lineinfile module
* Ansible Documentation - replace module
* Ansible Documentation - patch module

by Ophelia at Aug 03, 2024, 06:44 AM

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Nick name: Submit Cancel
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

0
0
0
10