diff --git a/check_raid.yml b/check_raid.yml index c52b952..3938d97 100644 --- a/check_raid.yml +++ b/check_raid.yml @@ -37,24 +37,40 @@ - name: Read /proc/mdstat from VM (via SSH) # English comments ansible.builtin.command: argv: + - timeout + - 25s - sshpass - -e - ssh - -o - StrictHostKeyChecking=no - -o - - ConnectTimeout=15 + - UserKnownHostsFile=/dev/null + - -o + - ConnectTimeout=10 + - -o + - ConnectionAttempts=1 + - -o + - NumberOfPasswordPrompts=1 + - -o + - PubkeyAuthentication=no + - -o + - GSSAPIAuthentication=no + - -o + - PasswordAuthentication=yes + - -o + - ServerAliveInterval=5 + - -o + - ServerAliveCountMax=2 - "{{ vm_user }}@{{ vm_ip }}" - - bash - - -lc - - "{{ ('sudo ' if use_sudo else '') + 'cat /proc/mdstat' }}" + - "cat /proc/mdstat" environment: SSHPASS: "{{ vm_pass }}" register: mdstat_cmd changed_when: false failed_when: false - no_log: "{{ DEBUG == 0 }}" # hides stdout/stderr in normal mode, but asserts below will still report summary - + no_log: "{{ DEBUG == 0 }}" + - name: Fail if we cannot read /proc/mdstat (SSH/auth/network) # English comments ansible.builtin.assert: that: