From 2cbad0b42b2f9bbc98e37282eebcbdce87a2e395 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Fri, 3 Aug 2018 09:01:44 +0200 Subject: [PATCH] Apply configuration according the desired state --- tasks/main.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index e0e4be9..8ac44d8 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -12,7 +12,6 @@ with_flattened: - '{{ netdata__base_packages }}' - # Server Manage /etc configuration files [[[1 - name: Ensure Netdata directory structure exists file: @@ -22,7 +21,7 @@ group: 'netdata' mode: '0755' with_filetree: '{{ netdata__etc_src }}' - when: item.state == 'directory' + when: (item.state == 'directory') and (netdata__deploy_state == "present") notify: ['Restart Netdata service'] - name: Generate Netdata configuration files @@ -33,7 +32,7 @@ group: 'netdata' mode: '{{ item.mode }}' with_filetree: '{{ netdata__etc_src }}' - when: item.state == 'file' + when: (item.state == 'file') and (netdata__deploy_state == "present") notify: ['Restart Netdata service'] - name: Generate Netdata configuration symlinks @@ -43,5 +42,5 @@ state: 'link' force: true with_filetree: '{{ netdata__etc_src }}' - when: item.state == 'link' + when: (item.state == 'link') and (netdata__deploy_state == "present") notify: ['Restart Netdata service']