| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- - name: Check if systemd.unified_cgroup_hierarchy=0 is in /proc/cmdline
- shell: "grep 'systemd.unified_cgroup_hierarchy=0' /proc/cmdline"
- register: unified_cgroup_hierarchy
- ignore_errors: true
- failed_when: false
- - debug: var=unified_cgroup_hierarchy.rc
- - debug: var=unified_cgroup_hierarchy.stdout
- - block:
- - name: Append systemd.unified_cgroup_hierarchy=0 to GRUB_CMDLINE_LINUX
- shell: |
- GRUB_FILE="/etc/default/grub"
- SEARCH_PATTERN="^GRUB_CMDLINE_LINUX="
- APPEND_TEXT="systemd.unified_cgroup_hierarchy=0 "
- if ! grep -q "systemd.unified_cgroup_hierarchy=0" "$GRUB_FILE"; then
- sed -i.bak.$(date +%Y%m%d-%H%M%S) "/$SEARCH_PATTERN/s/\"/& $APPEND_TEXT/" "$GRUB_FILE"
- fi
- args:
- executable: /bin/bash
- register: grub_update
- - name: Update GRUB
- command: update-grub
- - name: Check is need manual reboot to disable unified cgroup hierarchy
- fail:
- msg: "GRUB updated, Please reboot to disable cgroup hierarchy and run install script again"
- when: is_controller_node|default(false)|bool == true
- - name: Reboot the system
- reboot:
- reboot_timeout: 600
- async: 30
- poll: 0
- ignore_errors: true
- - name: Wait for the system to come back online
- become: yes
- wait_for_connection:
- delay: 15
- timeout: 600
- vars:
- ansible_connection: smart
- ansible_ssh_host: "{{ ansible_host }}" #
- when:
- - unified_cgroup_hierarchy.rc != 0
|