diff --git a/handlers/main.yml b/handlers/main.yml index 5963d66bdacd8411ecfbe957ebeeb49e39ccaecb..7b79d5b1fc8b161774640a097a4bbfadb81f2a66 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,11 +1,6 @@ --- # file: roles/netdata/handlers/main.yml -- name: "Install and configure NetData" - shell: ./netdata-installer.sh --dont-wait - args: - chdir: /opt/netdata - - name: "Include NetData to Boot-List" command: update-rc.d netdata defaults diff --git a/tasks/install.yml b/tasks/install.yml new file mode 100644 index 0000000000000000000000000000000000000000..932235636b287dfd36619191870cca59dd44dadd --- /dev/null +++ b/tasks/install.yml @@ -0,0 +1,18 @@ +--- +# file: roles/netdata/tasks/install.yml + +- name: "Clone NetData" + git: + accept_hostkey: true + repo: "https://github.com/firehol/netdata.git" + dest: "/opt/netdata" + force: yes + register: netdata_clone + notify: + - "Re-start NetData" + +- name: "Install and configure NetData" + shell: ./netdata-installer.sh --dont-wait + args: + chdir: /opt/netdata + when: netdata_clone.changed diff --git a/tasks/main.yml b/tasks/main.yml index d1a364f4288fc03c94234123a7a09c48c4926447..201449fd8998e6e4eb4cb7831fe376ecff6d8b9e 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -32,15 +32,7 @@ path='/etc/netdata/python.d' state='directory' - - name: "Clone NetData" - git: - accept_hostkey: true - repo: "https://github.com/firehol/netdata.git" - dest: "/opt/netdata" - force: yes - notify: - - "Install and configure NetData" - - "Re-start NetData" + - include: install.yml - name: "Install startup script" template: