September 2018
Beginner to intermediate
214 pages
5h 53m
English
The copy module is used to transfer files from the Ansible master to the remote hosts or locally from within the remote host. This is followed by unarchive, which is an archive extractor that then transfers the files to the selected hosts. The get_url module basically downloads a file from a web location as an HTTP, HTTPS, or FTP file. The following playbook shows how each module can be used to achieve a goal:
- name: copy file from within a remote host copy: src: /usr/local/script.py dest: /home/user1/script.py remote_src: yes owner: user1 group: developers mode: 0755 - name: extract an archive into remote hosts unarchive: src: ~/archive.tar.gz dest: /usr/local/ owner: user1 group: ...
Read now
Unlock full access