aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles/multipathd
diff options
context:
space:
mode:
authorRoman Krček <roman.krcek@tietoevry.com>2024-03-30 22:22:43 +0100
committerRoman Krček <roman.krcek@tietoevry.com>2024-06-28 09:04:43 +0200
commitfb3a8f5fa9373e0412bd8fd8317d7f1cd1083e37 (patch)
tree3b277f9c42143bcd9eaa987cf0cf8f19a0e979e1 /ansible/roles/multipathd
parent6e88d3dc794dc58856c8f6e14eea8f5761972064 (diff)
downloadkolla-ansible-fb3a8f5fa9373e0412bd8fd8317d7f1cd1083e37.tar.gz
kolla-ansible-fb3a8f5fa9373e0412bd8fd8317d7f1cd1083e37.zip
Performance: use filters for service dicts
Most roles are not leveraging the jinja filters available. According to [1] filtering the list of services makes the execution faster than skipping the tasks. This patchset also includes some cosmetic changes to genconfig. Individual services are now also using a jinja filter. This has no impact on performance, just makes the tasks look cleaner. Naming of some vars in genconfig was changed to "service" to make the tasks more uniform as some were previously using the service name and some were using "service". Three metrics from the deployment were taken and those were - overall deployment time [s] - time spent on the specific role [s] - CPU usage (measured with perf) [-] Overall genconfig time went down on avg. from 209s to 195s Time spent on the loadbalancer role went down on avg. from 27s to 23s Time spent on the neutron role went down on avg from 102s to 95s Time spent on the nova-cell role went down on avg. from 54s to 52s Also the average CPUs utilized reported by perf went down from 3.31 to 3.15. For details of how this was measured see the comments in gerrit. [1] - https://github.com/stackhpc/ansible-scaling/blob/master/doc/skip.md Change-Id: Ib0f00aadb6c7022de6e8b455ac4b9b8cd6be5b1b Signed-off-by: Roman Krček <roman.krcek@tietoevry.com>
Diffstat (limited to 'ansible/roles/multipathd')
-rw-r--r--ansible/roles/multipathd/tasks/check-containers.yml5
-rw-r--r--ansible/roles/multipathd/tasks/config.yml14
2 files changed, 4 insertions, 15 deletions
diff --git a/ansible/roles/multipathd/tasks/check-containers.yml b/ansible/roles/multipathd/tasks/check-containers.yml
index fe82a085f..5d41bdba5 100644
--- a/ansible/roles/multipathd/tasks/check-containers.yml
+++ b/ansible/roles/multipathd/tasks/check-containers.yml
@@ -9,9 +9,6 @@
ipc_mode: "{{ item.value.ipc_mode }}"
privileged: "{{ item.value.privileged | default(False) }}"
volumes: "{{ item.value.volumes }}"
- when:
- - inventory_hostname in groups[item.value.group]
- - item.value.enabled | bool
- with_dict: "{{ multipathd_services }}"
+ with_dict: "{{ multipathd_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"
diff --git a/ansible/roles/multipathd/tasks/config.yml b/ansible/roles/multipathd/tasks/config.yml
index f9281e9f8..9c75e93d6 100644
--- a/ansible/roles/multipathd/tasks/config.yml
+++ b/ansible/roles/multipathd/tasks/config.yml
@@ -7,10 +7,7 @@
group: "{{ config_owner_group }}"
mode: "0770"
become: true
- when:
- - inventory_hostname in groups[item.value.group]
- - item.value.enabled | bool
- with_dict: "{{ multipathd_services }}"
+ with_dict: "{{ multipathd_services | select_services_enabled_and_mapped_to_host }}"
- name: Copying over config.json files for services
template:
@@ -18,10 +15,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660"
become: true
- when:
- - inventory_hostname in groups[item.value.group]
- - item.value.enabled | bool
- with_dict: "{{ multipathd_services }}"
+ with_dict: "{{ multipathd_services | select_services_enabled_and_mapped_to_host }}"
notify:
- Restart multipathd container
@@ -37,8 +31,6 @@
- "{{ node_custom_config }}/multipath/{{ inventory_hostname }}/multipath.conf"
- "{{ node_custom_config }}/multipath.conf"
- "multipath.conf.j2"
- when:
- - inventory_hostname in groups[service.group]
- - service.enabled | bool
+ when: service | service_enabled_and_mapped_to_host
notify:
- Restart multipathd container