--- - hosts: netflows tasks: - name: Install fprobe Package become: yes apt: name: ['fprobe'] state: present update_cache: true tags: install_fprobe - lineinfile: path: /etc/default/fprobe state: present backrefs: yes regexp: '^FLOW_COLLECTOR="localhost:555"' line: 'FLOW_COLLECTOR="192.168.200.247:9995"' become: true - name: enable fprobe service and ensure it is not masked systemd: name: fprobe enabled: yes masked: no state: restarted tags: enable_fprobe become: true