aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles/tacker
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/tacker
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/tacker')
-rw-r--r--ansible/roles/tacker/tasks/check-containers.yml5
-rw-r--r--ansible/roles/tacker/tasks/config.yml19
2 files changed, 5 insertions, 19 deletions
diff --git a/ansible/roles/tacker/tasks/check-containers.yml b/ansible/roles/tacker/tasks/check-containers.yml
index e6e009979..fb3ac5140 100644
--- a/ansible/roles/tacker/tasks/check-containers.yml
+++ b/ansible/roles/tacker/tasks/check-containers.yml
@@ -9,9 +9,6 @@
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
- when:
- - item.value.host_in_groups | bool
- - item.value.enabled | bool
- with_dict: "{{ tacker_services }}"
+ with_dict: "{{ tacker_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"
diff --git a/ansible/roles/tacker/tasks/config.yml b/ansible/roles/tacker/tasks/config.yml
index ecdf54db2..518eee31d 100644
--- a/ansible/roles/tacker/tasks/config.yml
+++ b/ansible/roles/tacker/tasks/config.yml
@@ -7,10 +7,7 @@
group: "{{ config_owner_group }}"
mode: "0770"
become: true
- when:
- - item.value.host_in_groups | bool
- - item.value.enabled | bool
- with_dict: "{{ tacker_services }}"
+ with_dict: "{{ tacker_services | select_services_enabled_and_mapped_to_host }}"
- name: Check if policies shall be overwritten
stat:
@@ -41,10 +38,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660"
become: true
- with_dict: "{{ tacker_services }}"
- when:
- - item.value.host_in_groups | bool
- - item.value.enabled
+ with_dict: "{{ tacker_services | select_services_enabled_and_mapped_to_host }}"
notify:
- Restart {{ item.key }} container
@@ -61,10 +55,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/tacker.conf"
mode: "0660"
become: true
- with_dict: "{{ tacker_services }}"
- when:
- - item.value.host_in_groups | bool
- - item.value.enabled | bool
+ with_dict: "{{ tacker_services | select_services_enabled_and_mapped_to_host }}"
notify:
- Restart {{ item.key }} container
@@ -75,9 +66,7 @@
mode: "0660"
become: true
when:
- - item.value.host_in_groups | bool
- - item.value.enabled | bool
- tacker_policy_file is defined
- with_dict: "{{ tacker_services }}"
+ with_dict: "{{ tacker_services | select_services_enabled_and_mapped_to_host }}"
notify:
- Restart {{ item.key }} container