diff --git a/tasks/main.yml b/tasks/main.yml index 129b421..1d366b6 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -58,7 +58,7 @@ - common-mq - congress-config -- include_tasks: congress_pre_install.yml +- import_tasks: congress_pre_install.yml tags: - congress-install @@ -82,12 +82,12 @@ tags: - congress-install -- include_tasks: congress_post_install.yml +- import_tasks: congress_post_install.yml tags: - congress-config - name: Run the systemd service role - include_role: + import_role: name: systemd_service vars: systemd_user_name: "{{ congress_system_user_name }}" @@ -99,27 +99,18 @@ 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_congress_services }}" - loop_control: - loop_var: service_var + systemd_services: "{{ filtered_congress_services }}" tags: - congress-config - systemd-service -- include_tasks: congress_db_setup.yml +- import_tasks: congress_db_setup.yml when: - "inventory_hostname == ((groups['congress_all'] | intersect(ansible_play_hosts)) | list)[0]" tags: - congress-config -- include_tasks: congress_service_setup.yml +- import_tasks: congress_service_setup.yml when: - "inventory_hostname == ((groups['congress_all'] | intersect(ansible_play_hosts)) | list)[0]" tags: diff --git a/vars/main.yml b/vars/main.yml index 6b62fed..9af5332 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -24,7 +24,16 @@ filtered_congress_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( + { + 'service_key': key, + 'enabled': 'yes', + 'state': 'started', + 'config_overrides': value.init_config_overrides + } + ) + %} + {% set _ = value.pop('init_config_overrides') -%} {% set _ = services.append(value) %} {% endif %} {% endfor %}