add_line.yml 271 B

12345678910
  1. - name: add text to an existing file
  2. hosts: all
  3. remote_user: devops
  4. tasks:
  5. - name: add a single line of text to a file
  6. lineinfile:
  7. path: /home/devops/users.txt
  8. line: "This is a line added by the lineinfile module."
  9. state: present