Fix ISO mounting for VMware Hypervisor

This commit is contained in:
sandwich committed 2024-10-30 20:25:41 +01:00
1 parent 173ecd299b
commit e5660b0ba7
2 files changed
+16 -2

No files matched your search

+9 -1
View File
@@ -18,10 +18,18 @@
ansible.builtin.lineinfile:
path: /mnt/etc/fstab
regexp: '^.*\/dvd.*$'
line: "/dev/sr0 /usr/local/install/redhat/dvd iso9660 ro,relatime,nojoliet,check=s,map=n 0 0"
line: "{{ '/usr/local/install/redhat/rhel.iso /usr/local/install/redhat/dvd iso9660 loop,nofail 0 0' if hypervisor == 'vmware'
else '/dev/sr0 /usr/local/install/redhat/dvd iso9660 ro,relatime,nojoliet,check=s,map=n,nofail 0 0' }}"
state: present
backrefs: true
- name: Write image from RHEL ISO to the target machine
ansible.builtin.command: >
"dd if={{ '/dev/sr1' if hypervisor == 'vmware' else '/dev/sr2' }}
of=/mnt/usr/local/install/redhat/rhel.iso bs=4M status=progress"
changed_when: result.rc == 0
register: result
- name: Append TempFS to fstab
ansible.builtin.lineinfile:
path: /mnt/etc/fstab