Editing a Text File

Learn how to edit a configuration file in Ansible using the lineinfile command.

Editing configuration files is a day-to-day task for every system administrator. It can be a service configuration file, enabling options, or Unix parameters. All of these use cases require editing a text file.

Ansible lineinfile module

The ansible.builtin.lineinfile module in Ansible serves the purpose of editing text files, enabling users to insert, update, or remove a single line of text within the file. Being included in the collection of builtin modules, it comes shipped with every Ansible installation. This is designed to support a wide range of operating systems.

Press + to interact

Parameters

There are many ...