0 votes
in Ansible by
How can you use the Ansible module “lineinfile” to remove a line from a file?

a) By providing the contents of the file as a parameter to the module, with the line to remove omitted

b) By using a Jinja2 template to generate the contents of the file, with the line to remove omitted

c) By using the “line” parameter to specify the line to remove, and the “path” parameter to specify the path to the file

d) By using the “regexp” parameter to specify the pattern to match, and the “state” parameter with the value “absent”

1 Answer

0 votes
by
Solution: d) By using the “regexp” parameter to specify the pattern to match, and the “state” parameter with the value “absent”

Explanation: The Ansible module “lineinfile” can be used to remove a line from a file by using the “regexp” parameter to specify the pattern to match and the “state” parameter with the value “absent”.
...