containers.podman.podman_container_copy module – Copy file to/from a container
Note
This module is part of the containers.podman collection (version 1.16.2).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install containers.podman
.
To use it in a playbook, specify: containers.podman.podman_container_copy
.
Synopsis
Copy file or folder from the host to a container and vice-versa.
Parameters
Parameter |
Comments |
---|---|
Chown copied files to the primary uid/gid of the destination container. Choices:
|
|
Name/ID of the container to copy from/to |
|
Path of the destination file/folder to copy from/to the container |
|
Path to Default: |
|
Specify whether or not the file must be copied from the container to the host Choices:
|
|
Allow to overwrite directories with non-directories and vice versa Choices:
|
|
Path of the file/folder to copy from/to the container |
Notes
Note
Podman may required elevated privileges in order to run properly.
Examples
- name: Copy file "test.yml" on the host to the "apache" container's root folder
containers.podman.podman_search:
src: test.yml
dest: /
container: apache
- name: Copy file "test.yml" in the "apache" container's root folder to the playbook's folder
containers.podman.podman_search:
src: /test.yml
dest: ./
container: apache
from_container: True