Skip to content
Snippets Groups Projects
install.yml 1.18 KiB
Newer Older
  • Learn to ignore specific revisions
  • jurgenhaas's avatar
    jurgenhaas committed
    ---
    # file: roles/netdata/tasks/install.yml
    
    - name: "Clone NetData"
      git:
        accept_hostkey: true
    
    jurgenhaas's avatar
    jurgenhaas committed
        repo: "https://github.com/netdata/netdata.git"
    
    jurgenhaas's avatar
    jurgenhaas committed
        dest: "/opt/netdata"
        force: yes
    
    jurgenhaas's avatar
    jurgenhaas committed
        version: '{{ netdata_version }}'
    
    jurgenhaas's avatar
    jurgenhaas committed
      register: netdata_clone
    
      when: netdata_local_archive is not defined
      notify:
        - "Restart NetData"
    
    - name: "Extract NetData Archive"
      unarchive:
        src: '/opt/{{ netdata_local_archive }}.zip'
        dest: '/opt'
        remote_src: yes
    
    jurgenhaas's avatar
    jurgenhaas committed
      register: netdata_extract
    
      when: netdata_local_archive is defined
    
    jurgenhaas's avatar
    jurgenhaas committed
      notify:
    
    jurgenhaas's avatar
    jurgenhaas committed
    
    - name: "Install and configure NetData"
      shell: ./netdata-installer.sh --dont-wait
      args:
    
        chdir: /opt/{{ netdata_local_archive|default('netdata') }}
    
    jurgenhaas's avatar
    jurgenhaas committed
      when: netdata_clone.changed or netdata_extract.changed
    
    
    - name: "Install Custom Charts"
      template:
        src: '{{ item }}.chart.sh'
        dest: '/usr/libexec/netdata/charts.d/{{ item }}.chart.sh'
      with_items:
        - 'fluentd_buffer'
      notify:
        - "Restart NetData"
    
    - name: "Install Custom Alerts"
      template:
    
        src: 'health/{{ item }}.conf'
    
        dest: '/etc/netdata/health.d/{{ item }}.conf'
      with_items:
        - 'fluentd_buffer'
    
    jurgenhaas's avatar
    jurgenhaas committed
        - 'httpcheck'
    
      notify:
        - "Restart NetData"