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
I can enable target unit, but this action not valid for the current config service(service with multiple instances) and slice units. Code where define unit_status. I think can be done like this:
systemd/units/init.sls
- {% set unit_status = 'disable' if unitconfig.enabled is defined and unitconfig.enabled == false else 'enable' %}
+ {# {% set unit_status = 'disable' if unitconfig.enabled is defined and unitconfig.enabled == false else 'enable' %} #}
...
+ {% if unitconfig.enabled is defined %}
+ {% set unit_status = 'disable' if unitconfig.enabled == false else 'enable' %}
systemd_systemd_units_cmd_enable_or_disable_{{ unit }}_{{ unittype }}:
cmd.wait:
- name: systemctl {{ unit_status }} {{ unit }}.{{ unittype }}
- watch:
- cmd: reload_systemd_configuration
+ {% endif %}
In pillar explicitly define enabled variable.
This way state will try enable only necessary unittypes.
The text was updated successfully, but these errors were encountered:
Formula support this unittypes - https://github.com/saltstack-formulas/systemd-formula/blob/master/systemd/units/unittypes.yaml.
In this state https://github.com/saltstack-formulas/systemd-formula/blob/master/systemd/units/init.sls#L21 formula try doing enable for all types, but it is not always possible to do this, for example:
I can enable target unit, but this action not valid for the current config service(service with multiple instances) and slice units. Code where define unit_status. I think can be done like this:
In pillar explicitly define enabled variable.
This way state will try enable only necessary unittypes.
The text was updated successfully, but these errors were encountered: