From 5f0defd39bb723f3b6124c9f4fa15387e6f474e1 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Thu, 19 Jan 2017 10:53:38 +0000 Subject: [PATCH] Use systemd module instead of shell Using ansible systemd module to daemon reload and service reload is the solution for the future. Let's embrace it! Change-Id: Ic8d4312c2c7fe10ef4edb5b77a2068a21d8550db Signed-off-by: Jean-Philippe Evrard --- handlers/main.yml | 8 ++------ tasks/memcached_config.yml | 1 - 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/handlers/main.yml b/handlers/main.yml index 7f06f5c..bad0c20 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -13,12 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -- name: Reload the systemd daemon - command: "systemctl daemon-reload" - when: - - ansible_service_mgr == 'systemd' - - name: Restart memcached - service: + systemd: name: "memcached" state: "restarted" + daemon_reload: yes diff --git a/tasks/memcached_config.yml b/tasks/memcached_config.yml index 29fab6d..03478c1 100644 --- a/tasks/memcached_config.yml +++ b/tasks/memcached_config.yml @@ -61,7 +61,6 @@ - ansible_service_mgr == 'systemd' - memcached_connections > 1024 notify: - - Reload the systemd daemon - Restart memcached - name: Configure soft file limits