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>
This commit is contained in:
parent
b39c7219de
commit
d6481ef9fc
@ -104,8 +104,8 @@
|
|||||||
name: systemd_service
|
name: systemd_service
|
||||||
private: true
|
private: true
|
||||||
vars:
|
vars:
|
||||||
systemd_user_name: "{{ service_var.systemd_user_name | default(neutron_system_user_name) }}"
|
systemd_user_name: "{{ neutron_system_user_name }}"
|
||||||
systemd_group_name: "{{ service_var.systemd_group_name | default(neutron_system_group_name) }}"
|
systemd_group_name: "{{ neutron_system_group_name }}"
|
||||||
systemd_tempd_prefix: openstack
|
systemd_tempd_prefix: openstack
|
||||||
systemd_slice_name: neutron
|
systemd_slice_name: neutron
|
||||||
systemd_lock_path: /var/lock/neutron
|
systemd_lock_path: /var/lock/neutron
|
||||||
@ -113,18 +113,21 @@
|
|||||||
systemd_BlockIOAccounting: true
|
systemd_BlockIOAccounting: true
|
||||||
systemd_MemoryAccounting: true
|
systemd_MemoryAccounting: true
|
||||||
systemd_TasksAccounting: true
|
systemd_TasksAccounting: true
|
||||||
systemd_PrivateTmp: "{{ service_var.systemd_PrivateTmp | default(True) }}"
|
systemd_services: |-
|
||||||
systemd_services:
|
{%- set services = [] -%}
|
||||||
- service_name: "{{ service_var.service_name }}"
|
{%- for service in filtered_neutron_services -%}
|
||||||
enabled: yes
|
{%- set _ = service.update(
|
||||||
state: started
|
{
|
||||||
service_type: "{{ service_var.service_type | default(systemd_default_service_type) }}"
|
'enabled': 'yes',
|
||||||
execstarts: "{{ service_var.execstarts }}"
|
'state': 'started',
|
||||||
execreloads: "{{ service_var.execreloads | default([]) }}"
|
'config_overrides': service.init_config_overrides
|
||||||
config_overrides: "{{ service_var.init_config_overrides }}"
|
}
|
||||||
with_items: "{{ filtered_neutron_services }}"
|
)
|
||||||
loop_control:
|
-%}
|
||||||
loop_var: service_var
|
{%- set _ = service.pop('init_config_overrides') -%}
|
||||||
|
{%- set _ = services.append(service) -%}
|
||||||
|
{%- endfor %}
|
||||||
|
{{- services -}}
|
||||||
tags:
|
tags:
|
||||||
- neutron-config
|
- neutron-config
|
||||||
- systemd-service
|
- systemd-service
|
||||||
|
@ -475,7 +475,6 @@ neutron_services:
|
|||||||
group: neutron_ovn_controller
|
group: neutron_ovn_controller
|
||||||
systemd_user_name: root
|
systemd_user_name: root
|
||||||
systemd_group_name: root
|
systemd_group_name: root
|
||||||
systemd_PrivateTmp: False
|
|
||||||
service_name: networking-ovn-metadata-agent
|
service_name: networking-ovn-metadata-agent
|
||||||
service_en: "{{ neutron_plugin_type == 'ml2.ovn' }}"
|
service_en: "{{ neutron_plugin_type == 'ml2.ovn' }}"
|
||||||
service_conf_path: "{{ neutron_conf_dir }}"
|
service_conf_path: "{{ neutron_conf_dir }}"
|
||||||
|
Loading…
Reference in New Issue
Block a user