diff --git a/ChangeLog.rst b/ChangeLog.rst index ac9c645d03..46a1e4301b 100644 --- a/ChangeLog.rst +++ b/ChangeLog.rst @@ -38,6 +38,10 @@ upgrading a MetalK8s 0.1 cluster to MetalK8s 0.2 (:ghissue:`147`) storage related actions. Please see :ref:`upgrade_from_MetalK8s_before_0.2.0` (:ghissue:`153`) +Features added +-------------- +:ghissue:`173` - Format pv in asynchronous mode (:ghpull:`181`) + Features added -------------- diff --git a/roles/setup_lvm_lv/defaults/main.yml b/roles/setup_lvm_lv/defaults/main.yml index 5877348721..1200ab0618 100644 --- a/roles/setup_lvm_lv/defaults/main.yml +++ b/roles/setup_lvm_lv/defaults/main.yml @@ -36,3 +36,7 @@ metalk8s_host_path_prefix: "/mnt" # Only the "size" attribute is mandatory. # The others attribute value will have the values specified in # metalk8s_lvm_lv_defaults variable + +format_async: 45 +format_poll: 5 +format_retries: 30000 diff --git a/roles/setup_lvm_lv/tasks/main.yml b/roles/setup_lvm_lv/tasks/main.yml index 5cb6bee53b..d2e0792290 100644 --- a/roles/setup_lvm_lv/tasks/main.yml +++ b/roles/setup_lvm_lv/tasks/main.yml @@ -105,8 +105,22 @@ dev: '{{ item.key }}' opts: '{{ item.value.fs_opts }}' force: '{{ item.value.force }}' + async: '{{ format_async }}' + poll: '{{ format_poll }}' + register: lv_format with_dict: '{{ metalk8s_lvm_all_lvs }}' +- name: 'Wait for filesystem to be formatted' + async_status: + jid: '{{ item.ansible_job_id }}' + loop_control: + label: '{{ item["item"].key }}' + with_items: >- + {{ lv_format.results|default([]) }} + register: job_result + until: job_result.finished + retries: '{{ format_retries }}' + - name: 'Setup LVM: Get UUIDs of LVM LVs' command: blkid -s UUID -o value {{ item.key }} check_mode: False