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:
Kevin Carter 2018-08-21 00:06:41 -05:00 committed by Kevin Carter (cloudnull)
parent b39c7219de
commit d6481ef9fc
2 changed files with 17 additions and 15 deletions

View File

@ -104,8 +104,8 @@
name: systemd_service
private: true
vars:
systemd_user_name: "{{ service_var.systemd_user_name | default(neutron_system_user_name) }}"
systemd_group_name: "{{ service_var.systemd_group_name | default(neutron_system_group_name) }}"
systemd_user_name: "{{ neutron_system_user_name }}"
systemd_group_name: "{{ neutron_system_group_name }}"
systemd_tempd_prefix: openstack
systemd_slice_name: neutron
systemd_lock_path: /var/lock/neutron
@ -113,18 +113,21 @@
systemd_BlockIOAccounting: true
systemd_MemoryAccounting: true
systemd_TasksAccounting: true
systemd_PrivateTmp: "{{ service_var.systemd_PrivateTmp | default(True) }}"
systemd_services:
- service_name: "{{ service_var.service_name }}"
enabled: yes
state: started
service_type: "{{ service_var.service_type | default(systemd_default_service_type) }}"
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

View File

@ -475,7 +475,6 @@ neutron_services:
group: neutron_ovn_controller
systemd_user_name: root
systemd_group_name: root
systemd_PrivateTmp: False
service_name: networking-ovn-metadata-agent
service_en: "{{ neutron_plugin_type == 'ml2.ovn' }}"
service_conf_path: "{{ neutron_conf_dir }}"