adding support to append grub cmdline params
The aim of this PS is to add support for appending grub cmdline params per node image type. For example for worker node we may need to apply hugepages and cpu pinning params. Change-Id: Ieb6104100325cf888046d31da0327b01eaa280ac
This commit is contained in:
parent
7f03302e89
commit
e932a714f7
@ -118,8 +118,9 @@ else
|
|||||||
export user_data=$(QCOW_BUNDLE)/$$subdir/user_data
|
export user_data=$(QCOW_BUNDLE)/$$subdir/user_data
|
||||||
export network_config=$(QCOW_BUNDLE)/$$subdir/network_data.json
|
export network_config=$(QCOW_BUNDLE)/$$subdir/network_data.json
|
||||||
# QCOW configs
|
# QCOW configs
|
||||||
export osconfig_params=$(QCOW_BUNDLE)/$$subdir/osconfig-*-vars.yaml
|
qcow_type=$$(echo $$subdir | sed -e "s/^qcow-//")
|
||||||
export qcow_params=$(QCOW_BUNDLE)/$$subdir/qcow-*-vars.yaml
|
export osconfig_params="$(QCOW_BUNDLE)/$$subdir/osconfig-$$qcow_type-vars.yaml"
|
||||||
|
export qcow_params="$(QCOW_BUNDLE)/$$subdir/qcow-$$qcow_type-vars.yaml"
|
||||||
# Shared configs
|
# Shared configs
|
||||||
export img_name=$$(cat $(QCOW_BUNDLE)/$$subdir/img_name)
|
export img_name=$$(cat $(QCOW_BUNDLE)/$$subdir/img_name)
|
||||||
sudo -E tools/cut_image.sh $(IMAGE_TYPE) $(QCOW_BUNDLE) $(IMAGE) "$(PROXY)" "$(NO_PROXY)"
|
sudo -E tools/cut_image.sh $(IMAGE_TYPE) $(QCOW_BUNDLE) $(IMAGE) "$(PROXY)" "$(NO_PROXY)"
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
# Settings here will be applied to /boot/grub/grub.cfg when grub is installed
|
# Settings here will be applied to /boot/grub/grub.cfg when grub is installed
|
||||||
|
- name: "Append any user-defined grub cmdline linux default"
|
||||||
|
set_fact:
|
||||||
|
grub_cmdline_linux_default: "{% if grub_cmdline_linux_default_append is defined %}{{ grub.GRUB_CMDLINE_LINUX_DEFAULT + grub_cmdline_linux_default_append }}{% else %}{{ grub.GRUB_CMDLINE_LINUX_DEFAULT }}{% endif %}"
|
||||||
- name: "Grub | Grub config"
|
- name: "Grub | Grub config"
|
||||||
template:
|
template:
|
||||||
src: grub.j2
|
src: grub.j2
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
when: run_context == default_run_context
|
when: run_context == default_run_context
|
||||||
- name: "configure grub"
|
- name: "configure grub"
|
||||||
include_tasks: grub.yaml
|
include_tasks: grub.yaml
|
||||||
when: run_context == default_run_context
|
when: run_context == default_run_context or run_context == qcow_run_context
|
||||||
- name: "configure kdump-tools"
|
- name: "configure kdump-tools"
|
||||||
include_tasks: kdump-tools.yaml
|
include_tasks: kdump-tools.yaml
|
||||||
when: run_context == default_run_context
|
when: run_context == default_run_context
|
||||||
|
@ -9,7 +9,7 @@ GRUB_TIMEOUT_STYLE=menu
|
|||||||
GRUB_TIMEOUT={{ grub.GRUB_TIMEOUT }}
|
GRUB_TIMEOUT={{ grub.GRUB_TIMEOUT }}
|
||||||
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
|
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
|
||||||
{% set ns = namespace (content = '') %}
|
{% set ns = namespace (content = '') %}
|
||||||
{% for arg in grub.GRUB_CMDLINE_LINUX_DEFAULT %}
|
{% for arg in grub_cmdline_linux_default %}
|
||||||
{% set ns.content = ns.content + ' ' + arg.name + '=' + arg.value %}
|
{% set ns.content = ns.content + ' ' + arg.name + '=' + arg.value %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
GRUB_CMDLINE_LINUX_DEFAULT="{{ ns.content }}"
|
GRUB_CMDLINE_LINUX_DEFAULT="{{ ns.content }}"
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
# Custom user-defined overrides to the `osconfig` playbook can be placed here.
|
# Custom user-defined overrides to the `osconfig` playbook can be placed here.
|
||||||
#
|
#
|
||||||
# You would only use this if you needed to apply some settings uniques to this
|
# You would only use this if you needed to apply some settings uniques to
|
||||||
# type of image (control-plane or data-plane). Ex: kernel boot params specific
|
# control-plane image. Ex: kernel boot params specific to non-worker nodes.
|
||||||
# to workers vs non-worker nodes.
|
|
||||||
|
@ -1 +0,0 @@
|
|||||||
../qcow-control-plane/osconfig-control-plane-vars.yaml
|
|
@ -0,0 +1,18 @@
|
|||||||
|
# Custom user-defined overrides to the `osconfig` playbook can be placed here.
|
||||||
|
#
|
||||||
|
# You would only use this if you needed to apply some settings uniques to
|
||||||
|
# data-plane image. Ex: hugepages and cpu pinning configuration
|
||||||
|
|
||||||
|
# grub_cmdline_linux_default_append:
|
||||||
|
# - name: hugepagesz
|
||||||
|
# value: "1G"
|
||||||
|
# - name: hugepages
|
||||||
|
# value: "100"
|
||||||
|
# - name: default_hugepagesz
|
||||||
|
# value: "1G"
|
||||||
|
# - name: isolcpus
|
||||||
|
# value: "4-43,48-87"
|
||||||
|
# - name: rcu_nocbs
|
||||||
|
# value: "4-43,48-87"
|
||||||
|
# - name: transparent_hugepage
|
||||||
|
# value: "never"
|
@ -25,8 +25,6 @@ workdir="$(realpath ${host_mount_directory})"
|
|||||||
# Overrides
|
# Overrides
|
||||||
: ${user_data:=$workdir/user_data}
|
: ${user_data:=$workdir/user_data}
|
||||||
: ${network_config:=$workdir/network_data.json}
|
: ${network_config:=$workdir/network_data.json}
|
||||||
: ${osconfig_params:=$workdir/qcow-control-plane/osconfig-control-plane-vars.yaml}
|
|
||||||
: ${qcow_params:=$workdir/qcow-control-plane/qcow-control-plane-vars.yaml}
|
|
||||||
|
|
||||||
if [ -n "$proxy" ]; then
|
if [ -n "$proxy" ]; then
|
||||||
export http_proxy=$proxy
|
export http_proxy=$proxy
|
||||||
|
Loading…
x
Reference in New Issue
Block a user