Clonezilla is usually used from boot media. This playbook prepares an ISO cache and optional host packages for imaging infrastructure.
- name: Prepare Clonezilla resources
hosts: clonezilla
become: true
vars:
clonezilla_iso_url: "https://downloads.sourceforge.net/clonezilla/clonezilla-live-current-amd64.iso"
clonezilla_iso_dest: "/srv/clonezilla/clonezilla-live-current-amd64.iso"
tasks:
- name: Ensure storage directory exists
ansible.builtin.file:
path: /srv/clonezilla
state: directory
mode: "0755"
- name: Download Clonezilla ISO
ansible.builtin.get_url:
url: "{{ clonezilla_iso_url }}"
dest: "{{ clonezilla_iso_dest }}"
mode: "0644"
- name: Install clonezilla package where available
ansible.builtin.package:
name: clonezilla
state: present
failed_when: false
- name: Verify ISO exists
ansible.builtin.stat:
path: "{{ clonezilla_iso_dest }}"
register: iso_stat
- name: Show ISO size
ansible.builtin.debug:
msg: "Clonezilla ISO size: {{ iso_stat.stat.size | default(0) }} bytes"