ansible.builtin.iso_extract (v2.9.27) — module

Extract files from an ISO image

| "added in version" 2.3 of ansible.builtin"

Authors: Jeroen Hoekx (@jhoekx), Matt Robinson (@ribbons), Dag Wieers (@dagwieers)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.9.27

Description

This module has two possible ways of operation.

If 7zip is installed on the system, this module extracts files from an ISO into a temporary directory and copies files to a given destination, if needed.

If the user has mount-capabilities (CAP_SYS_ADMIN on Linux) this module mounts the ISO image to a temporary location, and copies files to a given destination, if needed.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Extract kernel and ramdisk from a LiveCD
  iso_extract:
    image: /tmp/rear-test.iso
    dest: /tmp/virt-rear/
    files:
    - isolinux/kernel
    - isolinux/initrd.cgz

Inputs

    
dest:
    description:
    - The destination directory to extract files to.
    required: true
    type: path

files:
    description:
    - A list of files to extract from the image.
    - Extracting directories does not work.
    required: true
    type: list

force:
    aliases:
    - thirsty
    default: true
    description:
    - If C(yes), which will replace the remote file when contents are different than the
      source.
    - If C(no), the file will only be extracted and copied if the destination does not
      already exist.
    - Alias C(thirsty) has been deprecated and will be removed in 2.13.
    type: bool
    version_added: '2.4'
    version_added_collection: ansible.builtin

image:
    aliases:
    - path
    - src
    description:
    - The ISO image to extract files from.
    required: true
    type: path

executable:
    default: 7z
    description:
    - The path to the C(7z) executable to use for extracting files from the ISO.
    type: path
    version_added: '2.4'
    version_added_collection: ansible.builtin