fix: add check for autoexpand status before enabling on datapool
This commit is contained in:
parent
112d3679da
commit
ca7061911c
@ -31,10 +31,16 @@
|
|||||||
become: true
|
become: true
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
|
- name: Check if autoexpand is enabled
|
||||||
|
ansible.builtin.command: zpool get -H -o value autoexpand datapool
|
||||||
|
register: autoexpand_status
|
||||||
|
become: true
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
- name: Enable autoexpand on datapool
|
- name: Enable autoexpand on datapool
|
||||||
ansible.builtin.command: zpool set autoexpand=on datapool
|
ansible.builtin.command: zpool set autoexpand=on datapool
|
||||||
become: true
|
become: true
|
||||||
when: datapool_check.rc == 0
|
when: autoexpand_status.stdout != "on" and datapool_check.rc == 0
|
||||||
register: autoexpand_result
|
register: autoexpand_result
|
||||||
changed_when: autoexpand_result.rc == 0
|
changed_when: autoexpand_result.rc == 0
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user