You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Multiinstance unit service didn't support enable/disable or start/stop (it's like a template). Start/stop or enable/disable I can only with target or explicitly given instances:
In this code state try start start/stop only for service unittypes, but In my example it's need doing and for target unittypes. I think can be done like this:
- {% if unittype == 'service' %}
- {% set activation_status = unitconfig.status if unitconfig.status is defined and unitconfig.status == 'start' else 'stop' %}
+ {% if unittype == 'service' or unittype == 'target' %}
+ {% if unitconfig.status is defined %}
{% set activation_status = unitconfig.status if unitconfig.status == 'start' else 'stop' %}
systemd_systemd_units_activate_or_deactivate_{{ unit }}_{{ unittype }}:
cmd.wait:
- name: systemctl {{ activation_status }} {{ unit }}.{{ unittype }}
...
+ {% endif %}
In pillar explicitly define status variable.
The text was updated successfully, but these errors were encountered:
https://www.stevenrombauts.be/2019/01/run-multiple-instances-of-the-same-systemd-unit/
I needed to start multiple instances of a single unit automatically with systemd, write config like this:
Multiinstance unit service didn't support enable/disable or start/stop (it's like a template). Start/stop or enable/disable I can only with target or explicitly given instances:
In this code state try start start/stop only for service unittypes, but In my example it's need doing and for target unittypes. I think can be done like this:
In pillar explicitly define status variable.
The text was updated successfully, but these errors were encountered: