It changes the directory layout of the ansible playbook to a more "best practices" friendly approach using ansible roles and a real inventory file Co-authored-by: Ilya Kreymer <ikreymer@users.noreply.github.com>
		
			
				
	
	
		
			17 lines
		
	
	
		
			474 B
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			474 B
		
	
	
	
		
			YAML
		
	
	
	
	
	
| ---
 | |
| - name: Get the list of mounted filesystems
 | |
|   shell: set -o pipefail && cat /proc/mounts | awk '{ print $2}' | grep -E "^{{ mounted_fs }}"
 | |
|   register: get_mounted_filesystems
 | |
|   args:
 | |
|     executable: /bin/bash
 | |
|   failed_when: false
 | |
|   changed_when: get_mounted_filesystems.stdout | length > 0
 | |
|   check_mode: false
 | |
| 
 | |
| - name: Umount filesystem
 | |
|   mount:
 | |
|     path: "{{ item }}"
 | |
|     state: unmounted
 | |
|   with_items:
 | |
|     "{{ get_mounted_filesystems.stdout_lines | reverse | list }}"
 |