1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-03-21 20:59:10 +00:00
community.general/tests/integration/targets/iso_customize/tasks/iso_mount.yml
Felix Fontein 476f2bf641
Integration tests: replace ansible_xxx with ansible_facts.xxx (#11479)
Replace ansible_xxx with ansible_facts.xxx.
2026-02-07 18:18:48 +01:00

39 lines
1.3 KiB
YAML

# Copyright (c) 2022, Ansible Project
# Copyright (c) 2022, VMware, Inc. All Rights Reserved.
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
- debug: var=ansible_facts.distribution
- block:
- name: "Mount customized ISO on MAC"
command: "hdiutil attach {{ test_dir }}/{{ iso_name }} -mountroot {{ test_dir }}/iso_mount"
# For MAC, we have different root directory for different type of ISO
- set_fact:
mount_root_dir: "{{ test_dir }}/iso_mount/disk_image"
- set_fact:
mount_root_dir: "{{ test_dir }}/iso_mount/AUTOINSTALL"
when: iso_name.find('joliet') != -1
- set_fact:
mount_root_dir: "{{ test_dir }}/iso_mount/CDROM"
when: iso_name.find('udf') != -1
when: ansible_facts.distribution == "MacOSX"
- block:
- name: "Mount {{ iso_name }} to {{ test_dir }}/iso_mount on localhost"
become: true
ansible.posix.mount:
path: "{{ test_dir }}/iso_mount"
src: "{{ test_dir }}/{{ iso_name }}"
opts: "ro,noauto"
fstab: "{{ test_dir }}/temp.fstab"
fstype: "iso9660"
state: mounted
- set_fact:
mount_root_dir: "{{ test_dir }}/iso_mount"
when:
- ansible_facts.distribution != "MacOSX"