yusefnapora / pixelbook-linux

257 stars 50 forks source link

kpartx -av can generate two digit loopback mapper devices causing ansible to fail a regexp match #31

Open earl-ducaine opened 4 years ago

earl-ducaine commented 4 years ago

When creating a loopback image of eve_recovery_image, kpartx -av can create a device whose loopback id contains two digits. This causes the regular expression Ansible uses (loop[0-9]p3) to fail to find a match in the stdout of kpartx. The solution is to match for any number of digits greater than or equal to 1 e.g., loop11p3, using the regexp: (loop[0-9]+p3)

`` diff --git a/ansible/roles/eve-recovery-files/tasks/main.yml b/ansible/roles/eve-recovery-files/tasks/main.yml index eb8f863..8debc75 100644 --- a/ansible/roles/eve-recovery-files/tasks/main.yml +++ b/ansible/roles/eve-recovery-files/tasks/main.yml @@ -35,7 +35,7 @@ set_fact: mapper_device: "{{ kpartx_output.stdout | regex_search(regexp, '\1') | first }}" vars:

flantel commented 4 years ago

Yes, there is a pull request #4 for this already. Original dev does not appear too active. I have this and a few more fixes in my fork.