mirror of
https://github.com/trailofbits/algo.git
synced 2025-08-09 14:23:05 +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
|
||||
when: facts.ansible_system == "Linux"
|
||||
|
||||
- name: MacOS | check fs the ramdisk exists
|
||||
command: /usr/sbin/diskutil info "{{ facts.tmpfs_volume_name }}"
|
||||
ignore_errors: true
|
||||
changed_when: false
|
||||
register: diskutil_info
|
||||
- block:
|
||||
- name: MacOS | check fs the ramdisk exists
|
||||
command: /usr/sbin/diskutil info "{{ facts.tmpfs_volume_name }}"
|
||||
ignore_errors: true
|
||||
changed_when: false
|
||||
register: diskutil_info
|
||||
|
||||
- name: MacOS | unmount and eject the ram disk
|
||||
shell:
|
||||
/usr/sbin/diskutil umount force "/{{ facts.tmpfs_volume_path }}/{{ facts.tmpfs_volume_name }}/" &&
|
||||
/usr/sbin/diskutil eject "{{ facts.tmpfs_volume_name }}"
|
||||
changed_when: false
|
||||
- name: MacOS | unmount and eject the ram disk
|
||||
shell:
|
||||
/usr/sbin/diskutil umount force "/{{ facts.tmpfs_volume_path }}/{{ facts.tmpfs_volume_name }}/" &&
|
||||
/usr/sbin/diskutil eject "{{ facts.tmpfs_volume_name }}"
|
||||
changed_when: false
|
||||
when: diskutil_info.rc == 0
|
||||
register: result
|
||||
until: result.rc == 0
|
||||
retries: 5
|
||||
delay: 3
|
||||
when:
|
||||
- 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