Avoid looping systemd_service role include
Tasks within the systemd_service role already handle looping over the 'systemd_services' list. The full list can be pre-created as passed as a var so that the systemd_service role only needs to be included and run once. This change also removes the hard set use of PrivateTmp which causes neutron to recieve "RTNETLINK" errors in namespaces. Change-Id: Ib25af54c5681c996b3a8ccc63911b62c64c21bf4 Signed-off-by: Kevin Carter <kevin.carter@rackspace.com> (cherry picked from commit d6481ef9fcfc85ff931317b6f16bdac43cbb6488)
This commit is contained in:
parent
5a20db85d2
commit
76e62caa93
@ -113,16 +113,21 @@
|
||||
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_neutron_services }}"
|
||||
loop_control:
|
||||
loop_var: service_var
|
||||
systemd_services: |-
|
||||
{%- set services = [] -%}
|
||||
{%- for service in filtered_neutron_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:
|
||||
- neutron-config
|
||||
- systemd-service
|
||||
|
Loading…
x
Reference in New Issue
Block a user