From 5338e8cbdb4500c71833e682658a5eec5c4299eb Mon Sep 17 00:00:00 2001 From: Alexander Weidinger Date: Thu, 21 Mar 2024 22:45:22 +0100 Subject: [PATCH] fix(apache.service.running): prevent recursive requisite --- apache/config/file.sls | 16 +++++++--------- apache/service/running.sls | 12 ++---------- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/apache/config/file.sls b/apache/config/file.sls index 2da8862c..9cc5c93c 100644 --- a/apache/config/file.sls +++ b/apache/config/file.sls @@ -19,7 +19,7 @@ apache-config-file-directory-logdir: - makedirs: True - require: - sls: {{ sls_package_install }} - - require_in: + - watch_in: - service: apache-service-running apache-config-file-directory-vhostdir: @@ -28,7 +28,7 @@ apache-config-file-directory-vhostdir: - makedirs: True - require: - sls: {{ sls_package_install }} - - require_in: + - watch_in: - service: apache-service-running apache-config-file-directory-moddir: @@ -37,7 +37,7 @@ apache-config-file-directory-moddir: - makedirs: True - require: - sls: {{ sls_package_install }} - - require_in: + - watch_in: - service: apache-service-running {%- if apache.davlockdbdir %} @@ -53,7 +53,7 @@ apache-config-file-directory-davlockdbdir: - group - require: - sls: {{ sls_package_install }} - - require_in: + - watch_in: - service: apache-service-running {%- endif %} @@ -65,7 +65,7 @@ apache-config-file-directory-sites-enabled: - makedirs: True - require: - sls: {{ sls_package_install }} - - require_in: + - watch_in: - service: apache-service-running {%- endif %} @@ -77,7 +77,7 @@ apache-config-file-directory-conf-enabled: - makedirs: True - require: - sls: {{ sls_package_install }} - - require_in: + - watch_in: - service: apache-service-running {%- endif %} @@ -111,7 +111,7 @@ apache-config-file-managed-{{ grains.os }}-env: - template: {{ apache.get('template_engine', 'jinja') }} - context: apache: {{ apache | json }} - - require_in: + - watch_in: - file: apache-config-file-managed-{{ grains.os }}-ports apache-config-file-managed-{{ grains.os }}-ports: @@ -158,6 +158,4 @@ apache-config-file-managed-skip: - sls: {{ sls_package_install }} - watch_in: - module: apache-service-running-restart - - require_in: - - module: apache-service-running-restart - service: apache-service-running diff --git a/apache/service/running.sls b/apache/service/running.sls index 07299777..fed21e7e 100644 --- a/apache/service/running.sls +++ b/apache/service/running.sls @@ -16,8 +16,6 @@ apache-service-running: service.running: - name: {{ apache.service.name }} - enable: True - - watch: - - sls: {{ sls_config_file }} - retry: {{ apache.retry_option|json }} cmd.run: - names: @@ -41,10 +39,7 @@ apache-service-running-restart: - cmd: {{ apache.custom_reload_command|default('apachectl graceful') }} - python_shell: True {%- endif %} - - watch: - - sls: {{ sls_config_file }} - - require: - - sls: {{ sls_config_file }} + - after: - service: apache-service-running apache-service-running-reload: @@ -57,8 +52,5 @@ apache-service-running-reload: - cmd: {{ apache.custom_reload_command|default('apachectl graceful') }} - python_shell: True {%- endif %} - - watch: - - sls: {{ sls_config_file }} - - require: - - sls: {{ sls_config_file }} + - after: - service: apache-service-running