Skip to content

Commit

Permalink
fix potential space exhaustion (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
swapdisk authored Apr 24, 2024
1 parent 0554530 commit a7c37f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/fix_image_copy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- Fix potential space exhaustion when restoring previous initramfs
13 changes: 3 additions & 10 deletions roles/initramfs/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@
reboot_timeout: "{{ initramfs_reboot_timeout }}"

- name: Restore previous initramfs
ansible.builtin.copy:
remote_src: true
src: /boot/initramfs-{{ initramfs_kernel_version }}.img.{{ initramfs_backup_extension }}
dest: /boot/initramfs-{{ initramfs_kernel_version }}.img
mode: "0600"

- name: Remove initramfs backup file
ansible.builtin.file:
path: /boot/initramfs-{{ initramfs_kernel_version }}.img.{{ initramfs_backup_extension }}
state: absent
# yamllint disable-line rule:line-length
ansible.builtin.command: '/usr/bin/mv -f /boot/initramfs-{{ initramfs_kernel_version }}.img.{{ initramfs_backup_extension }} /boot/initramfs-{{ initramfs_kernel_version }}.img'
changed_when: true

0 comments on commit a7c37f7

Please sign in to comment.