theko2fi.multipass.multipass_mount module – Module to manage directory mapping between host and Multipass virtual machine
Note
This module is part of the theko2fi.multipass collection (version 0.3.0).
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 theko2fi.multipass
.
To use it in a playbook, specify: theko2fi.multipass.multipass_mount
.
New in theko2fi.multipass 0.3.0
Synopsis
Mount a local directory in a Multipass virtual machine.
Unmount a directory from a Multipass virtual machine.
Parameters
Parameter |
Comments |
---|---|
A list of group IDs mapping for use in the mount. Use the Multipass CLI syntax File and folder ownership will be mapped from <host> to <instance> inside the VM. Default: |
|
Name of the virtual machine to operate on. |
|
Path of the local directory to mount Use with |
|
target mount point (path inside the VM). If omitted when If omitted when |
|
Specify the type of mount to use.
Choices:
|
|
A list of user IDs mapping for use in the mount. Use the Multipass CLI syntax File and folder ownership will be mapped from <host> to <instance> inside the VM. Default: |
Examples
- name: Mount '/root/data' directory from the host to '/root/data' inside the VM named 'healthy-cankerworm'
theko2fi.multipass.multipass_mount:
name: healthy-cankerworm
source: /root/data
- name: Mount '/root/data' to '/tmp' inside the VM
theko2fi.multipass.multipass_mount:
name: healthy-cankerworm
source: /root/data
target: /tmp
state: present
- name: Unmount '/tmp' directory from the VM
theko2fi.multipass.multipass_mount:
name: healthy-cankerworm
target: /tmp
state: absent
- name: Mount directory, set file and folder ownership
theko2fi.multipass.multipass_mount:
name: healthy-cankerworm
source: /root/data
target: /tmp
state: present
type: classic
uid_map:
- "50:50"
- "1000:1000"
gid_map:
- "50:50"
- name: Unmount all mount points from the 'healthy-cankerworm' VM
theko2fi.multipass.multipass_mount:
name: healthy-cankerworm
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Empty if Returned: when Sample: |