Open SkypLabs opened 1 year ago
It is not possible to enable the Nginx service without starting it as shown here:
{% set service_function = {True:'running', False:'dead'}.get(nginx.service.enable) %}
I would like to be able to enable the service without starting it (useful when creating VM images) or start the service without enabling it.
I would suggest dissociating the Salt state function to use (e.g. running, dead) from the value of the enable pillar option:
running
dead
enable
nginx: service: enable: true start: true
By introducing the new pillar option start, it becomes possible to enable the service without starting it and vice versa:
start
{% set service_function = {True:'running', False:'dead'}.get(nginx.service.start) %} ... nginx_service: service.{{ service_function }}: {{ sls_block(nginx.service.opts) }} - name: {{ nginx.lookup.service }} - enable: {{ nginx.service.enable }} ...
This is made possible because both running and dead functions have the same enable parameter to enable or not the service.
Nothing comes to my mind.
Nothing to add.
Is your feature request related to a problem?
It is not possible to enable the Nginx service without starting it as shown here:
I would like to be able to enable the service without starting it (useful when creating VM images) or start the service without enabling it.
Describe the solution you'd like
I would suggest dissociating the Salt state function to use (e.g.
running
,dead
) from the value of theenable
pillar option:By introducing the new pillar option
start
, it becomes possible to enable the service without starting it and vice versa:This is made possible because both
running
anddead
functions have the sameenable
parameter to enable or not the service.Describe alternatives you've considered
Nothing comes to my mind.
Additional context
Nothing to add.