mrlesmithjr / ansible-mdadm

60 stars 42 forks source link

Task fails at Removing arrays #23

Closed CendioMartin closed 2 years ago

CendioMartin commented 2 years ago

Describe the bug Task fails when trying to destroy array by setting state=absent

To Reproduce Steps to reproduce the behavior:

  1. Change state: present to state: absent in playbook
 vars:
    mdadm_arrays:
      - name: 'md0'
        devices:
          - '/dev/sdb'
          - '/dev/sdc'
        filesystem: 'lvm'
        level: 1
        state: present

Output from play:

TASK [ansible-mdadm : arrays | Removing Array(s)] **************************************************************************************************************************
failed: [storage.xyz.abcdef.com] (item={'name': 'md0', 'devices': ['/dev/sdb', '/dev/sdc'], 'filesystem': 'lvm', 'level': 1, 'state': 'absent'}) => changed=true 
  ansible_loop_var: item
  cmd:
  - mdadm
  - --remove
  - /dev/md0
  delta: '0:00:00.002178'
  end: '2022-02-04 12:48:51.857826'
  item:
    devices:
    - /dev/sdb
    - /dev/sdc
    filesystem: lvm
    level: 1
    name: md0
    state: absent
  msg: non-zero return code
  rc: 1
  start: '2022-02-04 12:48:51.855648'
  stderr: 'mdadm: error opening /dev/md0: No such file or directory'
  stderr_lines: <omitted>
  stdout: ''
  stdout_lines: <omitted>

Expected behavior The playbook should complete without errors

Desktop (please complete the following information):

Additional context It seems like the MD device is already removed from the system from the task before, "Stopping raid arrays in preparation of destroying". I don't know if the device is removed on systems other than RHEL

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.