Skip to content

Instantly share code, notes, and snippets.

@davidlares
Last active October 18, 2022 04:47
Show Gist options
  • Save davidlares/7073289a50f3ce8ae08803addd843e4a to your computer and use it in GitHub Desktop.
Save davidlares/7073289a50f3ce8ae08803addd843e4a to your computer and use it in GitHub Desktop.
A simple Ansible playbook script for copying files to remote machines
name: Copy file to target servers
hosts: all
tasks:
- name: Copy file
copy:
src: /tmp/test-file.txt
dest: /etc/foo.conf
target1 ansible_host=192.168.1.114 ansible_ssh_pass=osboxes.org
target2 ansible_host=192.168.1.115 ansible_ssh_pass=osboxes.org
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment