remove loop control when running include_role

When running an included role with_items + loop control is slow. This
change feeds the role the entire list of curated services which will
improve execution speed, especially when dealing with hundreds of hosts.

Change-Id: Ib022360f9eb17b7c8ef4b10f059a1dcdee126d58
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter 2018-10-04 00:52:24 -05:00 committed by Kevin Carter (cloudnull)
parent 66af063713
commit 8157a45d77
2 changed files with 21 additions and 16 deletions

View File

@ -456,7 +456,11 @@ nova_libvirtd_debug_log_filters: "3:remote 4:event 3:json 3:rpc"
nova_api_metadata_init_overrides: {}
nova_api_os_compute_init_overrides: {}
nova_compute_init_overrides: {}
nova_compute_init_overrides:
Unit:
? libvirtd.service
? syslog.target
? network.target
nova_conductor_init_overrides: {}
nova_consoleauth_init_overrides: {}
nova_novncproxy_init_overrides: {}
@ -496,10 +500,6 @@ nova_services:
start_order: 6
execstarts: "{{ nova_bin }}/nova-compute"
execreloads: "/bin/kill -HUP $MAINPID"
after_targets:
- libvirtd.service
- syslog.target
- network.target
nova-conductor:
group: nova_conductor
service_name: nova-conductor

View File

@ -141,7 +141,6 @@
name: systemd_service
private: true
vars:
systemd_after_targets: "{{ service_var.after_targets | default(['syslog.target', 'network.target']) }}"
systemd_user_name: "{{ nova_system_user_name }}"
systemd_group_name: "{{ nova_system_group_name }}"
systemd_tempd_prefix: openstack
@ -151,16 +150,22 @@
systemd_BlockIOAccounting: true
systemd_MemoryAccounting: true
systemd_TasksAccounting: true
systemd_services:
- service_name: "{{ service_var.service_name }}"
enabled: yes
state: started
execstarts: "{{ service_var.execstarts }}"
execreloads: "{{ service_var.execreloads | default([]) }}"
config_overrides: "{{ service_var.init_config_overrides }}"
with_items: "{{ filtered_nova_services }}"
loop_control:
loop_var: service_var
systemd_services: |-
{% set services = [] %}
{% for service in filtered_nova_services %}
{%
set _ = service.update(
{
'enabled': 'yes',
'state': 'started',
'config_overrides': service.init_config_overrides
}
)
%}
{% set _ = service.pop('init_config_overrides') -%}
{% set _ = services.append(service) -%}
{% endfor %}
{{ services }}
tags:
- nova-config
- systemd-service