This article was originally published on bmf-tech.com.
Overview
This task involves copying files (contents of a directory) from a local machine to a remote location using Ansible.
Playbook
---
- hosts: vps
become: yes
user: root
tasks:
- name: Copy a directory
copy:
src: /path/to/directory/
dest: /usr/local/bin/
mode: u+x
This task copies all contents of a directory to the remote /usr/local/bin directory. Permissions are also specified.
Thoughts
There don't seem to be any tricky points; it works as documented.
Top comments (0)