Merge "Convert dynamic includes to static imports"

This commit is contained in:
Zuul 2019-06-28 13:16:56 +00:00 committed by Gerrit Code Review
commit b57ffd43b9
2 changed files with 6 additions and 13 deletions

View File

@ -33,7 +33,7 @@
- zun-install
- name: Install the python venv
include_role:
import_role:
name: "python_venv_build"
vars:
venv_build_constraints: "{{ zun_git_constraints }}"
@ -101,7 +101,7 @@
- zun-config
- name: Run the systemd service role
include_role:
import_role:
name: systemd_service
vars:
systemd_user_name: "{{ zun_system_user_name }}"
@ -113,16 +113,7 @@
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: "{{ zun_service_defaults | combine(service_var.init_config_overrides) }}"
with_items: "{{ filtered_zun_services }}"
loop_control:
loop_var: service_var
systemd_services: "{{ filtered_zun_services }}"
tags:
- zun-config
- systemd-service

View File

@ -23,7 +23,9 @@ filtered_zun_services: |-
{% if (value['group'] in group_names) and
(('condition' not in value) or
('condition' in value and value['condition'])) %}
{% set _ = value.update({'service_key': key}) %}
{% set _ = value.update({'enabled': 'yes', 'state': 'started'}) %}
{% set _ = value.update({'config_overrides': (zun_service_defaults | combine(value.init_config_overrides))}) %}
{% set _ = value.pop('init_config_overrides') %}
{% set _ = services.append(value) %}
{% endif %}
{% endfor %}