Skip to content

Commit

Permalink
Format lvm lv asynchronously
Browse files Browse the repository at this point in the history
Fixes: #173
  • Loading branch information
Julien Girardin committed Jul 25, 2018
1 parent 1f42dea commit f5ee3e9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.rst
Expand Up @@ -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
--------------
Expand Down
4 changes: 4 additions & 0 deletions roles/setup_lvm_lv/defaults/main.yml
Expand Up @@ -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
14 changes: 14 additions & 0 deletions roles/setup_lvm_lv/tasks/main.yml
Expand Up @@ -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
Expand Down

0 comments on commit f5ee3e9

Please sign in to comment.