Note
This module is part of the community.general collection (version 10.7.3).
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 community.general. You need further requirements to be able to use this module, see Requirements for details.
To use it in a playbook, specify: community.general.iso_customize.
New in community.general 5.8.0
add_files.The below requirements are needed on the host that executes this module.
Parameter | Comments |
|---|---|
add_files list / elements=dictionary | Allows to add and replace files in the ISO file. It creates intermediate folders inside the ISO file when they do not exist. Default: |
|
dest_file string / required |
The absolute path of the file inside the ISO file. |
|
src_file path / required |
The path with file name on the machine the module is executed on. |
delete_files list / elements=string | Absolute paths for files inside the ISO file that should be removed. Default: |
dest_iso path / required | The path of the customized ISO file. |
src_iso path / required | This is the path of source ISO file. |
Attribute | Support | Description |
|---|---|---|
check_mode | Support: full | Can run in |
diff_mode | Support: none | Will return details on what has changed (or possibly needs changing in |
Note
pycdlib library states it supports Python 2.7 and 3.4+.add_file in pycdlib is designed to overwrite the existing file in ISO with type ISO9660 / Rock Ridge 1.12 / Joliet / UDF. But it does not overwrite the existing file in ISO with Rock Ridge 1.09 / 1.10. So we take workaround “delete the existing file and then add file for ISO with Rock Ridge”.- 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
Common return values are documented here, the following are the fields unique to this module:
Key | Description |
|---|---|
dest_iso string | Path of the customized ISO file. Returned: on success Sample: |
src_iso string | Path of source ISO file. Returned: on success Sample: |
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/community/general/iso_customize_module.html