|
6 | 6 | # and before overcloud host configure - we can't assume
|
7 | 7 | # users and venvs exist.
|
8 | 8 | ansible_user: "{{ bootstrap_user }}"
|
9 |
| - ansible_python_interpreter: "/usr/bin/python3" |
10 | 9 | ansible_ssh_common_args: "-o StrictHostKeyChecking=no"
|
| 10 | + ansible_python_interpreter: "/usr/bin/python3" |
11 | 11 | vfio_pci_ids: |-
|
12 | 12 | {% set output = [] %}
|
13 | 13 | {% for gpu_type in gpu_group_map | dict2items | map(attribute='value') | flatten | unique | default([]) %}
|
14 | 14 | {% set _ = output.append(stackhpc_gpu_data[gpu_type]['vendor_id'] + ':' + stackhpc_gpu_data[gpu_type]['product_id']) %}
|
15 | 15 | {% endfor %}
|
16 | 16 | {{ output | join(',') }}
|
| 17 | + reboot_timeout_s: "{{ 20 * 60 }}" |
17 | 18 | tasks:
|
18 | 19 | - name: Template dracut config
|
19 | 20 | blockinfile:
|
|
27 | 28 | become: true
|
28 | 29 | notify:
|
29 | 30 | - Regenerate initramfs
|
30 |
| - - reboot |
| 31 | + - Reboot |
31 | 32 |
|
32 | 33 | - name: Add vfio to modules-load.d
|
33 | 34 | blockinfile:
|
|
56 | 57 | create: true
|
57 | 58 | become: true
|
58 | 59 | notify:
|
59 |
| - - reboot |
| 60 | + - Reboot |
60 | 61 | - Regenerate initramfs
|
61 | 62 |
|
62 | 63 | - name: Ignore unsupported model specific registers
|
|
83 | 84 | group: root
|
84 | 85 | create: true
|
85 | 86 | become: true
|
86 |
| - notify: reboot |
| 87 | + notify: Reboot |
87 | 88 |
|
88 | 89 | - name: Add vfio-pci.ids kernel args
|
89 | 90 | include_role:
|
|
99 | 100 | - vfio-pci.ids
|
100 | 101 |
|
101 | 102 | handlers:
|
102 |
| - - name: Regenerate initramfs |
103 |
| - command: /usr/sbin/update-initramfs -u |
| 103 | + - name: Regenerate initramfs (RedHat) |
| 104 | + listen: Regenerate initramfs |
| 105 | + ansible.builtin.shell: |- |
| 106 | + #!/bin/bash |
| 107 | + set -eux |
| 108 | + dracut -v -f /boot/initramfs-$(uname -r).img $(uname -r) |
104 | 109 | become: true
|
| 110 | + changed_when: true |
| 111 | + when: ansible_facts.os_family == 'RedHat' |
105 | 112 |
|
106 |
| - # TODO: Check if this works |
107 |
| - - name: reboot |
108 |
| - import_playbook: reboot.yml |
| 113 | + - name: Regenerate initramfs (Debian) |
| 114 | + listen: Regenerate initramfs |
| 115 | + ansible.builtin.shell: |- |
| 116 | + #!/bin/bash |
| 117 | + set -eux |
| 118 | + update-initramfs -u -k $(uname -r) |
| 119 | + become: true |
| 120 | + changed_when: true |
| 121 | + when: ansible_facts.os_family == 'Debian' |
| 122 | + |
| 123 | + - name: Reboot |
| 124 | + become: true |
| 125 | + ansible.builtin.reboot: |
| 126 | + reboot_timeout: "{{ reboot_timeout_s }}" |
| 127 | + search_paths: |
| 128 | + # Systems running molly-guard hang waiting for confirmation before rebooting without this. |
| 129 | + - /lib/molly-guard |
| 130 | + # Default list: |
| 131 | + - /sbin |
| 132 | + - /bin |
| 133 | + - /usr/sbin |
| 134 | + - /usr/bin |
| 135 | + - /usr/local/sbin |
0 commit comments