How to copy block of lines to end of file through Ansible
Following playbook can be used to push block of lines in list.cfg(in this case) to nrpe.cfg at End of file.
We can push to many number of servers from single ansible Control node.
---
- name: copy the repo
hosts: localhost
tasks:
- blockinfile:
block: "{{ lookup('file', 'list.cfg') }}"
dest: /etc/nagios/nrpe.cfg
backup: yes
register: output