@@ -20,16 +20,32 @@ include:
2020 {%- set servicename = name if ' service' not in software else software.service.name % }
2121
2222{{ formula }}- service- dead- {{ comp }}- {{ servicename }}- clean:
23+ {%- if grains.kernel| lower == ' darwin' % } {# service.running is buggy #}
24+ cmd.run:
25+ - names:
26+ - launchctl stop {{ servicename }} || true
27+ - launchctl unload / Library/ LaunchAgents/ {{ servicename }}.plist || true
28+ {%- else % }
2329 service.dead:
2430 - name: {{ servicename }}
2531 {% if grains.kernel| lower == ' linux' % }
2632 - onlyif: systemctl list - units | grep {{ servicename }} > / dev/ null 2 > & 1
2733 {%- endif % } {# linux #}
2834 - enable: False
35+ {%- endif % }
36+ - require_in:
37+ - sls: {{ sls_config_clean }}
2938 file .absent:
3039 - names:
3140 - {{ d.dir.service }}/ {{ servicename }}.service
3241 - / etc/ logrotate.d/ {{ formula }}_{{ servicename }}
42+ {%- if ' systemLog' in config and ' destination' in config[' systemLog' ] % }
43+ {%- if config[' systemLog' ][' destination' ] == ' file' % }
44+ - {{ config[' systemLog' ][' path' ] }}
45+ {%- else % }
46+ - {{ ' /var/log/mongodb/' ~ servicename ~ ' .log' }}
47+ {%- endif % }
48+ {%- endif % }
3349 - require_in:
3450 - sls: {{ sls_config_clean }}
3551 {% if grains.kernel| lower == ' linux' % }
@@ -43,18 +59,20 @@ include:
4359 file .absent:
4460 - names:
4561 - / tmp/ MySiLydUmMyFiLE
46- {%- if ' processManagement' in config and config[ ' processManagement ' ][ ' pidFilePath ' ] % }
62+ {%- if ' processManagement' in config and ' pidFilePath ' in config[ ' processManagement ' ] % }
4763 - {{ config[' processManagement' ][' pidFilePath' ] }}
48- {%- endif % }
49- {%- if ' storage' in config and ' dbPath' in config[' storage' ] % }
64+ {%- else % }
65+ - {{ ' /var/run/{{ name }} .pid' }}
66+ {%- endif % }
67+ {%- if ' storage' in config and ' dbPath' in config[' storage' ] % }
5068 - {{ config[' storage' ][' dbPath' ] }}
51- {%- endif % }
52- {%- if ' schema' in config and ' path' in config[' schema' ] % }
69+ {%- endif % }
70+ {%- if ' schema' in config and ' path' in config[' schema' ] % }
5371 - {{ config[' schema' ][' path' ] }}
54- {%- endif % }
55- {%- if ' systemLog' in config and ' path' in config[' systemLog' ] % }
72+ {%- endif % }
73+ {%- if ' systemLog' in config and ' path' in config[' systemLog' ] % }
5674 - {{ config[' systemLog' ][' path' ] }}
57- {%- endif % }
75+ {%- endif % }
5876 - require_in:
5977 - sls: {{ sls_config_clean }}
6078
0 commit comments