Member-only story

Copy files from remote hosts — Ansible module fetch

How to copy files from remote hosts with Ansible? Simple code how to copy /var/log/messages from managed host to controller.

Luca Berton
3 min readAug 24, 2021

How to Copy files from remote hosts with Ansible?

I’m going to show you a live demo with some simple Ansible code.

I’m Luca Berton and welcome to today’s episode of Ansible Pilot

Ansible copy files from remote hosts

Today we’re talking about Ansible module fetch.

The full name is ansible.builtin.fetch which means is part of the collection of modules “builtin” with ansible and shipped with it.

This module is pretty stable and out for years.

The purpose is to copy files from remote locations. Please note that the opposite is done by module copy.

Parameters

  • dest path
  • src string
  • fail_on_missing boolean
  • validate_checksum boolean
  • flat boolean

--

--

Luca Berton
Luca Berton

Written by Luca Berton

I help creative Automation DevOps, Cloud Engineer, System Administrator, and IT Professional to succeed with Ansible Technology to automate more things everyday

No responses yet