Compare commits
8 Commits
pre-commit
...
libertacas
Author | SHA1 | Date | |
---|---|---|---|
9cf4951f15 | |||
2abb801af7 | |||
a6f1fb91d5 | |||
e1685ffbeb | |||
b22a6cf1bb | |||
9f2bcb52b7 | |||
14aa73e1ab | |||
4157db4d29 |
@ -30,7 +30,7 @@ repos:
|
|||||||
additional_dependencies: ['@commitlint/config-conventional@8.3.4']
|
additional_dependencies: ['@commitlint/config-conventional@8.3.4']
|
||||||
always_run: true
|
always_run: true
|
||||||
- repo: https://github.com/rubocop-hq/rubocop
|
- repo: https://github.com/rubocop-hq/rubocop
|
||||||
rev: v1.42.0
|
rev: v1.30.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: rubocop
|
- id: rubocop
|
||||||
name: Check Ruby files with rubocop
|
name: Check Ruby files with rubocop
|
||||||
@ -38,14 +38,14 @@ repos:
|
|||||||
always_run: true
|
always_run: true
|
||||||
pass_filenames: false
|
pass_filenames: false
|
||||||
- repo: https://github.com/shellcheck-py/shellcheck-py
|
- repo: https://github.com/shellcheck-py/shellcheck-py
|
||||||
rev: v0.9.0.2
|
rev: v0.8.0.4
|
||||||
hooks:
|
hooks:
|
||||||
- id: shellcheck
|
- id: shellcheck
|
||||||
name: Check shell scripts with shellcheck
|
name: Check shell scripts with shellcheck
|
||||||
files: ^.*\.(sh|bash|ksh)$
|
files: ^.*\.(sh|bash|ksh)$
|
||||||
types: []
|
types: []
|
||||||
- repo: https://github.com/adrienverge/yamllint
|
- repo: https://github.com/adrienverge/yamllint
|
||||||
rev: v1.28.0
|
rev: v1.26.3
|
||||||
hooks:
|
hooks:
|
||||||
- id: yamllint
|
- id: yamllint
|
||||||
name: Check YAML syntax with yamllint
|
name: Check YAML syntax with yamllint
|
||||||
@ -58,8 +58,8 @@ repos:
|
|||||||
- id: salt-lint
|
- id: salt-lint
|
||||||
name: Check Salt files using salt-lint
|
name: Check Salt files using salt-lint
|
||||||
files: ^.*\.(sls|jinja|j2|tmpl|tst)$
|
files: ^.*\.(sls|jinja|j2|tmpl|tst)$
|
||||||
- repo: https://github.com/rstcheck/rstcheck
|
- repo: https://github.com/myint/rstcheck
|
||||||
rev: v6.1.1
|
rev: 3f929574
|
||||||
hooks:
|
hooks:
|
||||||
- id: rstcheck
|
- id: rstcheck
|
||||||
name: Check reST files using rstcheck
|
name: Check reST files using rstcheck
|
||||||
|
@ -2,14 +2,4 @@
|
|||||||
# vim: ft=sls
|
# vim: ft=sls
|
||||||
|
|
||||||
include:
|
include:
|
||||||
- .file
|
|
||||||
# .modules.clean # disable (exclude from init state)
|
|
||||||
# .modules # enable by default (read pillars)
|
|
||||||
# .debian_full
|
|
||||||
- .flags
|
|
||||||
- .logrotate
|
|
||||||
- .manage_security
|
|
||||||
- .no_default_vhost
|
|
||||||
# .own_default_vhost
|
|
||||||
- .register_site
|
|
||||||
- .vhosts
|
- .vhosts
|
||||||
|
@ -30,10 +30,6 @@ apache-config-vhosts-standard-{{ id }}:
|
|||||||
- require:
|
- require:
|
||||||
- pkg: apache-package-install-pkg-installed
|
- pkg: apache-package-install-pkg-installed
|
||||||
- watch_in:
|
- watch_in:
|
||||||
- module: apache-service-running-reload
|
|
||||||
- require_in:
|
|
||||||
- module: apache-service-running-restart
|
|
||||||
- module: apache-service-running-reload
|
|
||||||
- service: apache-service-running
|
- service: apache-service-running
|
||||||
|
|
||||||
{%- if site.get('DocumentRoot') != False %}
|
{%- if site.get('DocumentRoot') != False %}
|
||||||
@ -57,10 +53,6 @@ apache-config-vhosts-standard-{{ id }}-cmd-run-a2en:
|
|||||||
- require:
|
- require:
|
||||||
- file: apache-config-vhosts-standard-{{ id }}
|
- file: apache-config-vhosts-standard-{{ id }}
|
||||||
- watch_in:
|
- watch_in:
|
||||||
- module: apache-service-running-reload
|
|
||||||
- require_in:
|
|
||||||
- module: apache-service-running-restart
|
|
||||||
- module: apache-service-running-reload
|
|
||||||
- service: apache-service-running
|
- service: apache-service-running
|
||||||
|
|
||||||
{%- else %}
|
{%- else %}
|
||||||
@ -72,10 +64,6 @@ apache-config-vhosts-standard-{{ id }}-cmd-run-a2dis:
|
|||||||
- require:
|
- require:
|
||||||
- file: apache-config-vhosts-standard-{{ id }}
|
- file: apache-config-vhosts-standard-{{ id }}
|
||||||
- watch_in:
|
- watch_in:
|
||||||
- module: apache-service-running-reload
|
|
||||||
- require_in:
|
|
||||||
- module: apache-service-running-restart
|
|
||||||
- module: apache-service-running-reload
|
|
||||||
- service: apache-service-running
|
- service: apache-service-running
|
||||||
|
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
{%- set tplroot = tpldir.split('/')[0] %}
|
{%- set tplroot = tpldir.split('/')[0] %}
|
||||||
{%- from tplroot ~ "/map.jinja" import apache with context %}
|
{%- from tplroot ~ "/map.jinja" import apache with context %}
|
||||||
|
|
||||||
|
{#- consider moving this to an optional state or enabling it with a pillar option
|
||||||
{%- if 'deps' in apache.pkg and apache.pkg.deps and apache.pkg.deps is iterable and apache.pkg.deps is not string %}
|
{%- if 'deps' in apache.pkg and apache.pkg.deps and apache.pkg.deps is iterable and apache.pkg.deps is not string %}
|
||||||
apache-package-install-deps-pkg-installed:
|
apache-package-install-deps-pkg-installed:
|
||||||
pkg.installed:
|
pkg.installed:
|
||||||
@ -11,6 +12,7 @@ apache-package-install-deps-pkg-installed:
|
|||||||
- require:
|
- require:
|
||||||
- apache-package-install-pkg-installed
|
- apache-package-install-pkg-installed
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
#}
|
||||||
|
|
||||||
apache-package-install-pkg-installed:
|
apache-package-install-pkg-installed:
|
||||||
{%- if grains.os_family == 'Windows' %}
|
{%- if grains.os_family == 'Windows' %}
|
||||||
|
@ -2,63 +2,10 @@
|
|||||||
# vim: ft=sls
|
# vim: ft=sls
|
||||||
|
|
||||||
{%- set tplroot = tpldir.split('/')[0] %}
|
{%- set tplroot = tpldir.split('/')[0] %}
|
||||||
{%- set sls_config_file = tplroot ~ '.config.file' %}
|
|
||||||
{%- set sls_config_registersite = tplroot ~ '.config.register_site' %}
|
|
||||||
{%- from tplroot ~ "/map.jinja" import apache with context %}
|
{%- from tplroot ~ "/map.jinja" import apache with context %}
|
||||||
|
|
||||||
include:
|
|
||||||
- {{ sls_config_file }}
|
|
||||||
- {{ sls_config_registersite }}
|
|
||||||
|
|
||||||
apache-service-running:
|
apache-service-running:
|
||||||
{%- if salt['pillar.get']('apache:manage_service_states', True) %}
|
|
||||||
{# By default run apache service states (unless pillar is false) #}
|
|
||||||
service.running:
|
service.running:
|
||||||
- name: {{ apache.service.name }}
|
- name: {{ apache.service.name }}
|
||||||
- enable: True
|
- enable: True
|
||||||
- watch:
|
- reload: True
|
||||||
- sls: {{ sls_config_file }}
|
|
||||||
- retry: {{ apache.retry_option|json }}
|
|
||||||
cmd.run:
|
|
||||||
- names:
|
|
||||||
- journalctl -xe -u {{ apache.service.name }} || tail -20 /var/log/messages || true
|
|
||||||
- (service {{ apache.service.name }} restart && service {{ apache.service.name }} status) || true
|
|
||||||
- cat {{ apache.config }}
|
|
||||||
- onfail:
|
|
||||||
- service: apache-service-running
|
|
||||||
{%- endif %}
|
|
||||||
|
|
||||||
{# The following states are by default inert and can be used #}
|
|
||||||
{# by other states to trigger a restart or reload as needed. #}
|
|
||||||
|
|
||||||
apache-service-running-restart:
|
|
||||||
module.wait:
|
|
||||||
{%- if apache.service_state in ['running'] %}
|
|
||||||
- name: service.restart
|
|
||||||
- m_name: {{ apache.service.name }}
|
|
||||||
{%- else %}
|
|
||||||
- name: cmd.run
|
|
||||||
- cmd: {{ apache.custom_reload_command|default('apachectl graceful') }}
|
|
||||||
- python_shell: True
|
|
||||||
{%- endif %}
|
|
||||||
- watch:
|
|
||||||
- sls: {{ sls_config_file }}
|
|
||||||
- require:
|
|
||||||
- sls: {{ sls_config_file }}
|
|
||||||
- service: apache-service-running
|
|
||||||
|
|
||||||
apache-service-running-reload:
|
|
||||||
module.wait:
|
|
||||||
{%- if apache.service_state in ['running'] %}
|
|
||||||
- name: service.reload
|
|
||||||
- m_name: {{ apache.service.name }}
|
|
||||||
{%- else %}
|
|
||||||
- name: cmd.run
|
|
||||||
- cmd: {{ apache.custom_reload_command|default('apachectl graceful') }}
|
|
||||||
- python_shell: True
|
|
||||||
{%- endif %}
|
|
||||||
- watch:
|
|
||||||
- sls: {{ sls_config_file }}
|
|
||||||
- require:
|
|
||||||
- sls: {{ sls_config_file }}
|
|
||||||
- service: apache-service-running
|
|
||||||
|
Loading…
Reference in New Issue
Block a user