mirror of
https://github.com/trailofbits/algo.git
synced 2025-08-10 23:03:03 +02:00
run diskutil info only on Darwin kernels
This commit is contained in:
parent
dc727d45b4
commit
cb8e196429
1 changed files with 16 additions and 15 deletions
|
@ -5,21 +5,22 @@
|
||||||
state: absent
|
state: absent
|
||||||
when: facts.ansible_system == "Linux"
|
when: facts.ansible_system == "Linux"
|
||||||
|
|
||||||
- name: MacOS | check fs the ramdisk exists
|
- block:
|
||||||
command: /usr/sbin/diskutil info "{{ facts.tmpfs_volume_name }}"
|
- name: MacOS | check fs the ramdisk exists
|
||||||
ignore_errors: true
|
command: /usr/sbin/diskutil info "{{ facts.tmpfs_volume_name }}"
|
||||||
changed_when: false
|
ignore_errors: true
|
||||||
register: diskutil_info
|
changed_when: false
|
||||||
|
register: diskutil_info
|
||||||
|
|
||||||
- name: MacOS | unmount and eject the ram disk
|
- name: MacOS | unmount and eject the ram disk
|
||||||
shell:
|
shell:
|
||||||
/usr/sbin/diskutil umount force "/{{ facts.tmpfs_volume_path }}/{{ facts.tmpfs_volume_name }}/" &&
|
/usr/sbin/diskutil umount force "/{{ facts.tmpfs_volume_path }}/{{ facts.tmpfs_volume_name }}/" &&
|
||||||
/usr/sbin/diskutil eject "{{ facts.tmpfs_volume_name }}"
|
/usr/sbin/diskutil eject "{{ facts.tmpfs_volume_name }}"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
when: diskutil_info.rc == 0
|
||||||
|
register: result
|
||||||
|
until: result.rc == 0
|
||||||
|
retries: 5
|
||||||
|
delay: 3
|
||||||
when:
|
when:
|
||||||
- facts.ansible_system == "Darwin"
|
- facts.ansible_system == "Darwin"
|
||||||
- diskutil_info.rc == 0
|
|
||||||
register: result
|
|
||||||
until: result.rc == 0
|
|
||||||
retries: 5
|
|
||||||
delay: 3
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue