0 votes
in Ansible by
How can you use the Ansible module “lineinfile” to replace a line in a file on a target machine?

a) By using the “line” parameter to specify the line to replace and the “replace” parameter to specify the replacement line

b) By using the “replace” parameter to specify the line to replace and the “line” parameter to specify the replacement line

c) By using the “before” parameter to specify the line to replace and the “after” parameter to specify the replacement line

d) By using the “old” parameter to specify the line to replace and the “new” parameter to specify the replacement line

1 Answer

0 votes
by

Answer: b) By using the “replace” parameter to specify the line to replace and the “line” parameter to specify the replacement line

Explanation: The Ansible module “lineinfile” can be used to replace a line in a file on a target machine by using the “replace” parameter to specify the line to replace and the “line” parameter to specify the replacement line.

...