From ce72766b97edd746466f997f5b53eff933164aed Mon Sep 17 00:00:00 2001 From: Rabi Mishra Date: Wed, 5 Dec 2018 10:15:41 +0530 Subject: [PATCH] Update tuned profile variable configuration file if it exists Update /etc/tuned/{{ _TUNED_PROFILE_NAME_ }}-variables.conf only if it exists. Change-Id: I20562efd61ba49b3ae0af62c079967681e05aeed Closes-Bug: #1806812 --- extraconfig/pre_network/boot_param_tasks.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/extraconfig/pre_network/boot_param_tasks.yaml b/extraconfig/pre_network/boot_param_tasks.yaml index 52c8956457..6a21b9b771 100644 --- a/extraconfig/pre_network/boot_param_tasks.yaml +++ b/extraconfig/pre_network/boot_param_tasks.yaml @@ -32,12 +32,16 @@ # Tune-d Configuration - block: + - name: Check Tune-d Configuration file exists + stat: + path: /etc/tuned/{{ _TUNED_PROFILE_NAME_ }}-variables.conf + register: tuned_conf_stat_result - name: Tune-d Configuration lineinfile: dest: /etc/tuned/{{ _TUNED_PROFILE_NAME_ }}-variables.conf regexp: '^isolated_cores=.*' line: 'isolated_cores={{ _TUNED_CORES_ }}' - when: _TUNED_CORES_|default("") != "" + when: tuned_conf_stat_result.stat.exists and _TUNED_CORES_|default("") != "" - name: Tune-d profile activation shell: tuned-adm profile {{ _TUNED_PROFILE_NAME_ }}