Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/iso_customize/tasks/iso_mount.yml

raw
1 # Copyright (c) 2022, Ansible Project
2 # Copyright (c) 2022, VMware, Inc. All Rights Reserved.
3 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
4 # SPDX-License-Identifier: GPL-3.0-or-later
5
6 - debug: var=ansible_facts.distribution
7
8 - block:
9 - name: "Mount customized ISO on MAC"
10 command: "hdiutil attach {{ test_dir }}/{{ iso_name }} -mountroot {{ test_dir }}/iso_mount"
11
12 # For MAC, we have different root directory for different type of ISO
13 - set_fact:
14 mount_root_dir: "{{ test_dir }}/iso_mount/disk_image"
15
16 - set_fact:
17 mount_root_dir: "{{ test_dir }}/iso_mount/AUTOINSTALL"
18 when: iso_name.find('joliet') != -1
19
20 - set_fact:
21 mount_root_dir: "{{ test_dir }}/iso_mount/CDROM"
22 when: iso_name.find('udf') != -1
23 when: ansible_facts.distribution == "MacOSX"
24
25 - block:
26 - name: "Mount {{ iso_name }} to {{ test_dir }}/iso_mount on localhost"
27 become: true
28 ansible.posix.mount:
29 path: "{{ test_dir }}/iso_mount"
30 src: "{{ test_dir }}/{{ iso_name }}"
31 opts: "ro,noauto"
32 fstab: "{{ test_dir }}/temp.fstab"
33 fstype: "iso9660"
34 state: mounted
35
36 - set_fact:
37 mount_root_dir: "{{ test_dir }}/iso_mount"
38 when:
39 - ansible_facts.distribution != "MacOSX"