add_block.yml 314 B

123456789101112
  1. - name: add a ablock to an existing file
  2. hosts: all
  3. remote_user: devops
  4. tasks:
  5. - name: add a block
  6. blockinfile:
  7. path: /home/devops/users.txt
  8. block: |
  9. This block of text consists of two lines
  10. They have been added by the blockinfile module
  11. state: present