From 3c2decef667aaf6a71c9ef6b203989ae207019f5 Mon Sep 17 00:00:00 2001 From: Alessandro Fael Garcia Date: Tue, 5 Apr 2022 13:33:14 +0200 Subject: [PATCH] Add `TimeoutStartSec` parameter --- .github/workflows/requirements/requirements_ansible.yml | 2 +- CHANGELOG.md | 3 ++- README.md | 2 +- defaults/main/systemd.yml | 4 +++- templates/services/nginx.service.override.conf.j2 | 5 ++++- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/requirements/requirements_ansible.yml b/.github/workflows/requirements/requirements_ansible.yml index 00dbe7bfd..0f4c4dbde 100644 --- a/.github/workflows/requirements/requirements_ansible.yml +++ b/.github/workflows/requirements/requirements_ansible.yml @@ -5,4 +5,4 @@ collections: - name: ansible.posix version: 1.3.0 - name: community.docker - version: 2.2.1 + version: 2.3.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index c0c9429a3..fcb87dfc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,8 +9,9 @@ FEATURES: ENHANCEMENTS: -* Bump the Ansible `community.general` collection to `4.6.1` and `community.docker` collection to `2.2.1`. +* Bump the Ansible `community.general` collection to `4.6.1` and `community.docker` collection to `2.3.0`. * Streamline configuring SELinux. +* Add `TimeoutStartSec` parameter to Systemd template. BUG FIXES: diff --git a/README.md b/README.md index 4b5965f58..ba1905905 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ If you wish to install NGINX Plus using this role, you will need to obtain an NG - name: ansible.posix version: 1.3.0 - name: community.docker # Only required if you plan to use Molecule (see below) - version: 2.2.1 + version: 2.3.0 ``` **Note:** You can alternatively install the Ansible community distribution (what is known as the "old" Ansible) if you don't want to manage individual collections. diff --git a/defaults/main/systemd.yml b/defaults/main/systemd.yml index 7d9c006c7..94c2670e0 100644 --- a/defaults/main/systemd.yml +++ b/defaults/main/systemd.yml @@ -14,10 +14,12 @@ nginx_service_overridepath: /etc/systemd/system/nginx.service.d # Default is override.conf nginx_service_overridefilename: override.conf -# Set service timeout for systemd systems in seconds (default: 90) +# Set service timeout for systemd systems in seconds # [Service] +# TimeoutStartSec=90 # TimeoutStopSec=90 # Default is to comment this out +# nginx_service_timeoutstartsec: 90 # nginx_service_timeoutstopsec: 90 # Set the restart policy for systemd systems diff --git a/templates/services/nginx.service.override.conf.j2 b/templates/services/nginx.service.override.conf.j2 index 2fe623191..83093e00d 100644 --- a/templates/services/nginx.service.override.conf.j2 +++ b/templates/services/nginx.service.override.conf.j2 @@ -1,6 +1,9 @@ [Service] +{% if nginx_service_timeoutstartsec is defined %} +TimeoutStartSec={{ nginx_service_timeoutstartsec }} +{% endif %} {% if nginx_service_timeoutstopsec is defined %} -TimeoutStopSec={{ nginx_service_timeoutstopsec | default(90) }} +TimeoutStopSec={{ nginx_service_timeoutstopsec }} {% endif %} {% if nginx_service_restartonfailure is defined %} Restart=on-failure