Debug showed that even though job was being skipped it was still doing the register, that's why things were being dumb.
This commit is contained in:
		@@ -15,24 +15,6 @@
 | 
				
			|||||||
  ignore_errors: yes 
 | 
					  ignore_errors: yes 
 | 
				
			||||||
  when: not leet_drive_details.stat.exists
 | 
					  when: not leet_drive_details.stat.exists
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
- name: General | Account Management | Mounts | SSHFS Already Working
 | 
					 | 
				
			||||||
  shell: "echo SUCCESS"
 | 
					 | 
				
			||||||
  register: sshfs_test
 | 
					 | 
				
			||||||
  when: leet_drive_details.stat.exists
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Make super sure that the failed key exists.
 | 
					 | 
				
			||||||
# https://www.middlewareinventory.com/blog/ansible-dict/
 | 
					 | 
				
			||||||
- name: General | Account Management | Mounts | Check/Set sshfs_test.failed Key
 | 
					 | 
				
			||||||
  set_fact:         
 | 
					 | 
				
			||||||
    sshfs_test: "{{ sshfs_test | combine({item.key : item.value}) }}"
 | 
					 | 
				
			||||||
  with_items: 
 | 
					 | 
				
			||||||
    - { 'key': 'failed', 'value': false }
 | 
					 | 
				
			||||||
  when: sshfs_test.failed is not defined
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
- debug:
 | 
					 | 
				
			||||||
    var: sshfs_test
 | 
					 | 
				
			||||||
  
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Begin setting up 1337
 | 
					# Begin setting up 1337
 | 
				
			||||||
- name: General | Account Management | Mounts | Create 1337 Folder
 | 
					- name: General | Account Management | Mounts | Create 1337 Folder
 | 
				
			||||||
@@ -51,13 +33,15 @@
 | 
				
			|||||||
    marker: '# {mark} MANAGED BY ANSIBLE | 1337 Share'
 | 
					    marker: '# {mark} MANAGED BY ANSIBLE | 1337 Share'
 | 
				
			||||||
    state: present
 | 
					    state: present
 | 
				
			||||||
    backup: yes
 | 
					    backup: yes
 | 
				
			||||||
  when: ansible_system == "Linux" and not sshfs_test.failed
 | 
					  when: ansible_system == "Linux" and 
 | 
				
			||||||
 | 
					        (not sshfs_test.failed or leet_drive_details.stat.exists)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: General | Account Management | Mounts | Mount All (Linux)
 | 
					- name: General | Account Management | Mounts | Mount All (Linux)
 | 
				
			||||||
  shell: mount -a
 | 
					  shell: mount -a
 | 
				
			||||||
  args:
 | 
					  args:
 | 
				
			||||||
    warn: false
 | 
					    warn: false
 | 
				
			||||||
  when: ansible_system == "Linux" and not sshfs_test.failed
 | 
					  when: ansible_system == "Linux" and 
 | 
				
			||||||
 | 
					        (not sshfs_test.failed or leet_drive_details.stat.exists)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# FreeBSD has to do this via root cron job, fstab is unhappy
 | 
					# FreeBSD has to do this via root cron job, fstab is unhappy
 | 
				
			||||||
@@ -65,12 +49,14 @@
 | 
				
			|||||||
  shell: umount -f /mnt/leet
 | 
					  shell: umount -f /mnt/leet
 | 
				
			||||||
  args:
 | 
					  args:
 | 
				
			||||||
    warn: false
 | 
					    warn: false
 | 
				
			||||||
  when: ansible_system == "FreeBSD" and not sshfs_test.failed
 | 
					  when: ansible_system == "FreeBSD" and 
 | 
				
			||||||
 | 
					        (not sshfs_test.failed or leet_drive_details.stat.exists)
 | 
				
			||||||
  ignore_errors: yes
 | 
					  ignore_errors: yes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: General | Account Management | Mounts | Remount 1337 (FreeBSD)
 | 
					- name: General | Account Management | Mounts | Remount 1337 (FreeBSD)
 | 
				
			||||||
  shell: "{{ sshfs_leet_cmd }}"
 | 
					  shell: "{{ sshfs_leet_cmd }}"
 | 
				
			||||||
  when: ansible_system == "FreeBSD" and not sshfs_test.failed
 | 
					  when: ansible_system == "FreeBSD" and 
 | 
				
			||||||
 | 
					        (not sshfs_test.failed or leet_drive_details.stat.exists)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Ensure correct cron jobs and other downstream dependencies are done properly.
 | 
					# Ensure correct cron jobs and other downstream dependencies are done properly.
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user