copy contents of file on ansible server to another file on remote servers I have a bash script on about 70 severs in /opt/zservice/etc/config that i want to change its content with ansible. the new content is on ansible server in this path /data/new_config.
how i can use ansible (how to write a task) that reads this file new_config and then replace config content ?  

something like this in bash: /data/new_config &gt; /opt/zservice/etc/config
Copy module should work

- hosts: all  
  tasks:
    - copy:
        src: /data/new_config
        dest: /opt/zservice/etc/config
        owner: root
        group: wheel
        mode: '0750'
        backup: yes


If you worry about the number of the hosts take a look at serial.