From 656461169abced532c1d02c1e8d5b78e2c212d89 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 13 Feb 2021 06:01:45 -0600 Subject: [PATCH] Debug showed that even though job was being skipped it was still doing the register, that's why things were being dumb. --- tasks/general/acct_mgmt/mounts.yml | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/tasks/general/acct_mgmt/mounts.yml b/tasks/general/acct_mgmt/mounts.yml index 0777a60..cc80354 100644 --- a/tasks/general/acct_mgmt/mounts.yml +++ b/tasks/general/acct_mgmt/mounts.yml @@ -14,24 +14,6 @@ register: sshfs_test ignore_errors: yes 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 @@ -51,13 +33,15 @@ marker: '# {mark} MANAGED BY ANSIBLE | 1337 Share' state: present 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) shell: mount -a args: 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 @@ -65,12 +49,14 @@ shell: umount -f /mnt/leet args: 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 - name: General | Account Management | Mounts | Remount 1337 (FreeBSD) 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.