theko2fi.multipass.multipass_vm_transfer_into (0.3.0) — module

Copy a file into a Multipass virtual machine

| "added in version" 0.2.0 of theko2fi.multipass"

Authors: Kenneth KOFFI (@theko2fi)

Install collection

Install with ansible-galaxy collection install theko2fi.multipass:==0.3.0


Add to requirements.yml

  collections:
    - name: theko2fi.multipass
      version: 0.3.0

Description

Copy a file into a Multipass virtual machine.

Similar to C(multipass transfer).

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Copy a file into the VM
  theko2fi.multipass.multipass_vm_transfer_into:
    name: foo
    src: /home/user/data.txt
    dest: /home/ubuntu/input.txt
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Copy a content into the VM
  theko2fi.multipass.multipass_vm_transfer_into:
    name: foo
    content: "Hello World!"
    dest: /home/ubuntu/input.txt
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Copy a file into the VM (ignore errors)
  theko2fi.multipass.multipass_vm_transfer_into:
    name: foo
    src: /home/user/data.txt
    dest: /input.txt
  ignore_errors: true

Inputs

    
src:
    description:
    - Path to a file on the managed node.
    - Mutually exclusive with O(content). One of O(content) and O(src) is required.
    type: str

dest:
    description:
    - Path to a file inside the Multipass virtual machine.
    - Must be an absolute path.
    required: true
    type: str

name:
    description:
    - The name of the virtual machine to copy files to.
    required: true
    type: str

content:
    description:
    - The file's content.
    - If you plan to provide binary data, provide it pre-encoded to base64, and set O(content_is_b64=true).
    - Mutually exclusive with O(src). One of O(content) and O(src) is required.
    type: str

content_is_b64:
    default: false
    description:
    - If set to V(true), the content in O(content) is assumed to be Base64 encoded and
      will be decoded before being used.
    - To use binary O(content), it is better to keep it Base64 encoded and let it be decoded
      by this option. Otherwise you risk the data to be interpreted as UTF-8 and corrupted.
    type: bool