community.general.iso_customize (8.5.0) — module

Add/remove/change files in ISO file

| "added in version" 5.8.0 of community.general"

Authors: Yuhua Zou (@ZouYuhua) <zouy@vmware.com>

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

This module is used to add/remove/change files in ISO file.

The file inside ISO will be overwritten if it exists by option O(add_files).


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Customize ISO file"
  community.general.iso_customize:
    src_iso: "/path/to/ubuntu-22.04-desktop-amd64.iso"
    dest_iso: "/path/to/ubuntu-22.04-desktop-amd64-customized.iso"
    delete_files:
      - "/boot.catalog"
    add_files:
      - src_file: "/path/to/grub.cfg"
        dest_file: "/boot/grub/grub.cfg"
      - src_file: "/path/to/ubuntu.seed"
        dest_file: "/preseed/ubuntu.seed"
  register: customize_iso_result

Inputs

    
src_iso:
    description:
    - This is the path of source ISO file.
    required: true
    type: path

dest_iso:
    description:
    - The path of the customized ISO file.
    required: true
    type: path

add_files:
    default: []
    description:
    - Allows to add and replace files in the ISO file.
    - Will create intermediate folders inside the ISO file when they do not exist.
    elements: dict
    required: false
    suboptions:
      dest_file:
        description:
        - The absolute path of the file inside the ISO file.
        required: true
        type: str
      src_file:
        description:
        - The path with file name on the machine the module is executed on.
        required: true
        type: path
    type: list

delete_files:
    default: []
    description:
    - Absolute paths for files inside the ISO file that should be removed.
    elements: str
    required: false
    type: list

Outputs

dest_iso:
  description: Path of the customized ISO file.
  returned: on success
  sample: /path/to/customized.iso
  type: str
src_iso:
  description: Path of source ISO file.
  returned: on success
  sample: /path/to/file.iso
  type: str