From 04b1c99fd2b769979adf019fe064bc4ba601ef97 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 24 Jul 2017 11:15:37 -0500 Subject: libvirt: fall back to mkisofs if genisoimage isn't available --- README_libvirt.md | 2 +- playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README_libvirt.md b/README_libvirt.md index b8a24d705..1661681a0 100644 --- a/README_libvirt.md +++ b/README_libvirt.md @@ -15,7 +15,7 @@ Install dependencies 3. Install [ebtables](http://ebtables.netfilter.org/) 4. Install [qemu and qemu-system-x86](http://wiki.qemu.org/Main_Page) 5. Install [libvirt-python and libvirt](http://libvirt.org/) -6. Install [genisoimage](http://cdrkit.org/) +6. Install [genisoimage](http://cdrkit.org/) or [mkisofs](http://cdrtools.sourceforge.net/private/cdrecord.html) 7. Enable and start the libvirt daemon, e.g: - `systemctl enable libvirtd` - `systemctl start libvirtd` diff --git a/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml b/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml index ccd29be29..f445206ef 100644 --- a/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml +++ b/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml @@ -49,8 +49,12 @@ - '{{ instances }}' - [ user-data, meta-data ] +- name: Check for genisoimage + command: which genisoimage + register: which_genisoimage + - name: Create the cloud-init config drive - command: 'genisoimage -output {{ libvirt_storage_pool_path }}/{{ item }}_cloud-init.iso -volid cidata -joliet -rock user-data meta-data' + command: '{{ 'genisoimage' if which_genisoimage.rc == 0 else 'mkisofs'}} -output {{ libvirt_storage_pool_path }}/{{ item }}_cloud-init.iso -volid cidata -joliet -rock user-data meta-data' args: chdir: '{{ libvirt_storage_pool_path }}/{{ item }}_configdrive/' creates: '{{ libvirt_storage_pool_path }}/{{ item }}_cloud-init.iso' -- cgit v1.2.3