Skip to content

Commit

Permalink
fix setting tuned profile (#378)
Browse files Browse the repository at this point in the history
* fix setting tuned profile

move profile setting from ansible role to engine

* CR fixes for cleaer code
  • Loading branch information
dangel101 authored May 19, 2022
1 parent 2e6b59f commit 2afdb98
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,11 @@ private void runAnsibleHostDeployPlaybook() {
}
Cluster hostCluster = clusterDao.get(getClusterId());
boolean isGlusterServiceSupported = hostCluster.supportsGlusterService();
String tunedProfile = isGlusterServiceSupported ? hostCluster.getGlusterTunedProfile() : null;
String tunedProfile = "virtual-host";
if (hostCluster.supportsGlusterService() && StringUtils.isNotBlank(hostCluster.getGlusterTunedProfile())) {
// custom tuned profile is specified for gluster cluster
tunedProfile = hostCluster.getGlusterTunedProfile();
}
String clusterVersion = hostCluster.getCompatibilityVersion().getValue();
AnsibleCommandConfig commandConfig = new AnsibleCommandConfig()
.hosts(vds)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
---
- name: Set profile
set_fact:
profile: >
"{{ 'virtual-host' if (host_deploy_tuned_profile is none and host_deploy_virt_enabled|bool)
else host_deploy_tuned_profile }}"
- name: Get lastest tune package
yum:
name: tuned
Expand All @@ -16,7 +10,7 @@
state: started

- name: Set tune profile
shell: "tuned-adm profile {{ profile }}"
shell: "tuned-adm profile {{ host_deploy_tuned_profile }}"
register: tune_profile_set
tags:
- skip_ansible_lint # E305
Expand Down

0 comments on commit 2afdb98

Please sign in to comment.