Created
April 2, 2019 19:50
-
-
Save haslersn/9cc52d3d4c40e71c51685a9c116d64ca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/defaults/main.yml b/defaults/main.yml | |
| index 32b63b6..df9abf9 100644 | |
| --- a/defaults/main.yml | |
| +++ b/defaults/main.yml | |
| @@ -4,3 +4,4 @@ upgrade_restart_services_ignore: | |
| - dbus | |
| upgrade_do_autoremove: True | |
| upgrade_do_autoclean: True | |
| +upgrade_mirror_boot: False | |
| diff --git a/tasks/upgrade_debian.yml b/tasks/upgrade_debian.yml | |
| index fb81f3f..1f086db 100644 | |
| --- a/tasks/upgrade_debian.yml | |
| +++ b/tasks/upgrade_debian.yml | |
| @@ -24,10 +24,47 @@ | |
| debug: msg="{{ updates.stdout_lines | count }} packages to upgrade ({{ updates.stdout_lines | join(', ') }})" | |
| when: updates.stdout_lines | count > 1 | |
| +- name: Create mirrored /boot | |
| + file: | |
| + path: /tmp/boot | |
| + state: directory | |
| + when: upgrade_mirror_boot and updates.stdout_lines | count > 1 | |
| + | |
| +- name: Synchronize mirrored /boot | |
| + synchronize: | |
| + src: /boot | |
| + dest: /tmp/boot | |
| + when: upgrade_mirror_boot and updates.stdout_lines | count > 1 | |
| + | |
| +- name: Unmount /boot in order to mount its mirror | |
| + command: umount /boot | |
| + when: upgrade_mirror_boot and updates.stdout_lines | count > 1 | |
| + | |
| +- name: Mount mirrored /boot | |
| + command: mount --bind /tmp/boot /boot | |
| + when: upgrade_mirror_boot and updates.stdout_lines | count > 1 | |
| + | |
| - name: Upgrade packages | |
| apt: | |
| upgrade: safe | |
| +- name: Unmount mirrored /boot | |
| + command: umount /boot | |
| + when: upgrade_mirror_boot and updates.stdout_lines | count > 1 | |
| + | |
| +- name: Reload /etc/fstab | |
| + command: mount -a | |
| + when: upgrade_mirror_boot and updates.stdout_lines | count > 1 | |
| + | |
| +- name: Synchronize /boot | |
| + synchronize: | |
| + src: /tmp/boot | |
| + dest: /boot | |
| + when: upgrade_mirror_boot and updates.stdout_lines | count > 1 | |
| + | |
| +- name: Reload module dependencies | |
| + command: depmod | |
| + | |
| - name: Check what the new version is | |
| shell: lsb_release -r | awk '{print $2}' | |
| changed_when: False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment