From 7b87c090c52058c89f7df939b472aac19c66a887 Mon Sep 17 00:00:00 2001 From: Musee Ullah Date: Mon, 23 Oct 2017 13:40:17 -0700 Subject: [PATCH 1/2] ZFS configuration fixes Move ZFS tasks after kernel update tasks (reboot is required) Correctly specify module load and modprobe configuration for ZFS Add cleanup tasks when ZFS is disabled/etc --- handlers/main.yml | 5 +++++ tasks/kernel_module_cleanup.yml | 15 +++++++++++++++ tasks/main.yml | 8 +++++--- tasks/zfs.yml | 14 +++++++++++--- 4 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 tasks/kernel_module_cleanup.yml diff --git a/handlers/main.yml b/handlers/main.yml index 897b4092..7970e300 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -19,3 +19,8 @@ service: name: watchdog-mux state: restarted + +- name: restart zfs-zed + service: + name: zfs-zed + state: restarted diff --git a/tasks/kernel_module_cleanup.yml b/tasks/kernel_module_cleanup.yml new file mode 100644 index 00000000..09b257d9 --- /dev/null +++ b/tasks/kernel_module_cleanup.yml @@ -0,0 +1,15 @@ +--- +- name: Remove ZFS modprobe configuration + file: + dest: /etc/modprobe.d/zfs.conf + state: absent + when: > + (pve_zfs_options is not defined) or + (pve_zfs_options is defined and not pve_zfs_options) or + (not pve_zfs_enabled) + +- name: Disable loading of ZFS module on init + file: + dest: /etc/modules-load.d/zfs.conf + state: absent + when: not pve_zfs_enabled diff --git a/tasks/main.yml b/tasks/main.yml index 451e5f82..929bf9e7 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -94,13 +94,15 @@ backup: yes when: "'pve-no-subscription' in pve_repository_line" -- include: zfs.yml - when: pve_zfs_enabled +- include: kernel_updates.yml - include: ipmi_watchdog.yml when: pve_watchdog == 'ipmi' -- include: kernel_updates.yml +- include: zfs.yml + when: pve_zfs_enabled + +- include: kernel_module_cleanup.yml - include: pve_cluster_config.yml when: pve_cluster_enabled diff --git a/tasks/zfs.yml b/tasks/zfs.yml index 3fa5d2ac..b6039a31 100644 --- a/tasks/zfs.yml +++ b/tasks/zfs.yml @@ -1,19 +1,27 @@ --- -- name: Load zfs module +- name: Load ZFS module live modprobe: name: zfs params: "{{ pve_zfs_options | default(omit) }}" state: present tags: skiponlxc -- name: Configure zfs module to load on boot +- name: Load ZFS module on init copy: - content: "options zfs{% if pve_zfs_options is defined %} {{ pve_zfs_options }}{% endif %}" + content: zfs + dest: /etc/modules-load.d/zfs.conf + +- name: Copy ZFS modprobe configuration + copy: + content: "options zfs {{ pve_zfs_options }}" dest: /etc/modprobe.d/zfs.conf + when: pve_zfs_options is defined and pve_zfs_options - name: Configure email address for ZFS event daemon notifications lineinfile: dest: /etc/zfs/zed.d/zed.rc line: 'ZED_EMAIL_ADDR="{{ pve_zfs_zed_email }}"' regexp: '^#?ZED_EMAIL_ADDR=' + notify: + - restart zfs-zed when: pve_zfs_zed_email is defined From 465d07ad21ee3bfdb5ad71c0d04ce0954aaeac43 Mon Sep 17 00:00:00 2001 From: Musee Ullah Date: Mon, 23 Oct 2017 16:15:42 -0700 Subject: [PATCH 2/2] Add cleanup tasks for disabling IPMI watchdog --- tasks/kernel_module_cleanup.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tasks/kernel_module_cleanup.yml b/tasks/kernel_module_cleanup.yml index 09b257d9..1682d817 100644 --- a/tasks/kernel_module_cleanup.yml +++ b/tasks/kernel_module_cleanup.yml @@ -13,3 +13,35 @@ dest: /etc/modules-load.d/zfs.conf state: absent when: not pve_zfs_enabled + +- block: + - name: Re-enable nmi_watchdog via GRUB config + lineinfile: + dest: /etc/default/grub + line: 'GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX nmi_watchdog=0"' + state: absent + register: __pve_grub + + - name: Update GRUB configuration + command: update-grub + register: __pve_grub_update + failed_when: ('error' in __pve_grub_update.stderr) + when: __pve_grub|changed + tags: skiponlxc + + - name: Remove ipmi_watchdog modprobe configuration + file: + dest: /etc/modprobe.d/ipmi_watchdog.conf + state: absent + + - name: Load softdog + modprobe: + name: softdog + + - name: Set PVE HA Manager watchdog configuration back to default + copy: + content: "WATCHDOG_MODULE=softdog" + dest: /etc/default/pve-ha-manager + notify: + - restart watchdog-mux + when: pve_watchdog != 'ipmi'