Browse Source

Removed external role for gluon-collector, this will be done internally

Till Klocke 9 years ago
parent
commit
9de204804f
24 changed files with 0 additions and 448 deletions
  1. 0 2
      roles/external/ansible-gluon-collector/.gitignore
  2. 0 26
      roles/external/ansible-gluon-collector/.kitchen.yml
  3. 0 24
      roles/external/ansible-gluon-collector/.travis.yml
  4. 0 7
      roles/external/ansible-gluon-collector/Gemfile
  5. 0 63
      roles/external/ansible-gluon-collector/README.md
  6. 0 21
      roles/external/ansible-gluon-collector/defaults/main.yml
  7. 0 8
      roles/external/ansible-gluon-collector/handlers/main.yml
  8. 0 1
      roles/external/ansible-gluon-collector/meta/.galaxy_install_info
  9. 0 17
      roles/external/ansible-gluon-collector/meta/main.yml
  10. 0 54
      roles/external/ansible-gluon-collector/tasks/main.yml
  11. 0 16
      roles/external/ansible-gluon-collector/tasks/supervisor.yml
  12. 0 12
      roles/external/ansible-gluon-collector/tasks/systemd.yml
  13. 0 25
      roles/external/ansible-gluon-collector/templates/config.j2
  14. 0 11
      roles/external/ansible-gluon-collector/templates/supervisor.j2
  15. 0 11
      roles/external/ansible-gluon-collector/templates/systemd.j2
  16. 0 2
      roles/external/ansible-gluon-collector/test/ansible.cfg
  17. 0 12
      roles/external/ansible-gluon-collector/test/application/gluon-collector.yml
  18. 0 14
      roles/external/ansible-gluon-collector/test/integration/gluon-collector/serverspec/collector_spec.rb
  19. 0 1
      roles/external/ansible-gluon-collector/test/local.ini
  20. 0 17
      roles/external/ansible-gluon-collector/test/run_vagrant_kitchen.sh
  21. 0 98
      roles/external/ansible-gluon-collector/test/travis_run.py
  22. 0 2
      roles/external/ansible-gluon-collector/vars/main.yml
  23. 0 1
      roles/internal/ffdo.meshviewer/meta/main.yml
  24. 0 3
      roles/thirdparty_roles.yml

+ 0 - 2
roles/external/ansible-gluon-collector/.gitignore

@@ -1,2 +0,0 @@
-.kitchen/
-secrets

+ 0 - 26
roles/external/ansible-gluon-collector/.kitchen.yml

@@ -1,26 +0,0 @@
----
-driver:
-  name: vagrant
-
-provisioner:
-    name               : ansible_push
-    verbose            : "vvvv"
-    ansible_config     : "test/ansible.cfg"
-    idempotency_test   : False
-    sudo               : True
-    #chef_bootstrap_url : False
-    #extra_vars        : "@kitchen_vars.yml"
-
-platforms:
-    - name: Debian-jessie
-      driver:
-        box: debian/jessie64
-    - name: Ubuntu-trusty
-      driver:
-        box: ubuntu/trusty64
-
-suites:
-  - name: gluon-collector
-    provisioner:
-      playbook: "test/application/gluon-collector.yml"
-      extra_vars: {'kitchen_connection': 'smart'}

+ 0 - 24
roles/external/ansible-gluon-collector/.travis.yml

@@ -1,24 +0,0 @@
----
-language: python
-python: "2.7"
-
-env:
-- ANSIBLE_CONFIG=test/ansible.cfg
-
-before_install:
-  # Make sure everything's up to date.
-  - sudo apt-get update -qq
-  - sudo apt-get install -qq python-apt python-pycurl git python-pip ruby ruby-dev build-essential autoconf
-  - gem install bundler
-
-install:
-  - sudo pip install ansible
-
-
-script:
-    - ansible --version
-    - 'ansible-playbook --syntax-check --list-tasks -i "localhost," test/application/gluon-collector.yml'
-
-
-after_success:
-    - echo "Success"

+ 0 - 7
roles/external/ansible-gluon-collector/Gemfile

@@ -1,7 +0,0 @@
-source "https://rubygems.org"
-
-gem "test-kitchen"
-gem "kitchen-ansiblepush"
-gem "kitchen-ansible"
-gem "kitchen-vagrant"
-gem "kitchen-localhost"

+ 0 - 63
roles/external/ansible-gluon-collector/README.md

@@ -1,63 +0,0 @@
-gluon-collector [![Build Status](https://travis-ci.org/ffdo/ansible-gluon-collector.svg?branch=master)](https://travis-ci.org/ffdo/ansible-gluon-collector)
-=========
-
-This role configures and install the gluon-collector service.
-
-Requirements
-------------
-
-Ansible 1.9 and a Debian Linux based OS
-
-Role Variables
---------------
-
-* **gluon_collector_receivers** A hash describing one or multiple receiver blocks in the configuration
-
-### Default Variables 
-
-Variable | Default | Description
----------|---------|------------
-gluon_collector_http_port | 8079 | The port on which the REST server should listen on
-gluon_collector_http_address | "[::]" | The address string the REST server should listen on
-gluon_collector_store_type | bolt | The type of datastore to use
-gluon_collector_base_path | /opt/gluon-collector | Where should gluon-collector be installed
-gluon_collector_db_path | "{{gluon_collector_base_path}}/collector.db" | Where is the datastore created
-gluon_collector_config_path | "{{gluon_collector_base_path}}/gluon-collector.yml" | Where configuration is created
-gluon_collector_expire_nodes | 365 | After how many should dead nodes be removed from the datastore
-gluon_collector_log_level | warn | The log level to use
-gluon_collector_log_path | "{{gluon_collector_base_path}}/collector.log" | The location of the log file
-gluon_collector_interval_statistics | 300 | Interval in seconds to request node statistics
-gluon_collector_interval_nodeinfo | 1800 | Interval in seconds to request node infos
-gluon_collector_interval_expire | 3 | After how many intervals is a non responding considered offline
-gluon_collector_user | gluon-collector  | The user under which gluon-collector should run
-gluon_collector_group | gluon-collector | The group under whcih gluon-collector should run
-gluon_collector_version | "v1.1" | The version fetch from github releases
-gluon_collector_download_url | "https://github.com/ffdo/node-informant/releases/download/{{gluon_collector_version}}/gluon-collector" | The release download URL
-gluon_collector_use_supervisor | true | If this is false systemd instead of supervisor is used
-gluon_collector_supervisor_config_path | /etc/supervisor/conf.d | The path where the supervisor configuration is written
-
-Example Playbook
-----------------
-
-Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
-
-    - hosts: ansible-gluon-collector
-      roles:
-         - role: dereulenspiegel.gluon-collector
-           gluon_collector_receivers:
-           - type: announced
-             port: 21214
-             interface: bat0
-           - type: announced
-             port: 21214
-             interface: bat1 
-
-License
--------
-
-MIT
-
-Author Information
-------------------
-
-An optional section for the role authors to include contact information, or a website (HTML is not allowed).

+ 0 - 21
roles/external/ansible-gluon-collector/defaults/main.yml

@@ -1,21 +0,0 @@
----
-# defaults file for ansible-gluon-collector
-
-gluon_collector_http_port: 8079
-gluon_collector_http_address: "[::]"
-gluon_collector_store_type: bolt
-gluon_collector_base_path: /opt/gluon-collector
-gluon_collector_db_path: "{{gluon_collector_base_path}}/collector.db"
-gluon_collector_config_path: "{{gluon_collector_base_path}}/gluon-collector.yml"
-gluon_collector_expire_nodes: 365
-gluon_collector_log_level: warn
-gluon_collector_log_path: "{{gluon_collector_base_path}}/collector.log"
-gluon_collector_interval_statistics: 300
-gluon_collector_interval_nodeinfo: 1800
-gluon_collector_interval_expire: 3
-gluon_collector_user: gluon-collector 
-gluon_collector_group: gluon-collector
-gluon_collector_version: "v1.1"
-gluon_collector_download_url: "https://github.com/ffdo/node-informant/releases/download/{{gluon_collector_version}}/gluon-collector"
-gluon_collector_use_supervisor: true
-gluon_collector_supervisor_config_path: /etc/supervisor/conf.d

+ 0 - 8
roles/external/ansible-gluon-collector/handlers/main.yml

@@ -1,8 +0,0 @@
----
-# handlers file for ansible-gluon-collector
-
-- name: Restart gluon-collector
-  when: gluon_collector_use_supervisor
-  supervisorctl:
-    name: gluon-collector
-    state: restarted

+ 0 - 1
roles/external/ansible-gluon-collector/meta/.galaxy_install_info

@@ -1 +0,0 @@
-{install_date: 'Sat Dec 19 23:08:27 2015', version: v1.0}

+ 0 - 17
roles/external/ansible-gluon-collector/meta/main.yml

@@ -1,17 +0,0 @@
----
-galaxy_info:
-  author: Till Klocke
-  description: Install and configure gluon-collector
-  company: Freifunk Dortmund
-  license: MIT
-  min_ansible_version: 1.9
-  platforms:
-  - name: Ubuntu
-    versions:
-    - trusty
-  - name: Debian
-    versions:
-    - jessie
-  categories:
-  - monitoring
-dependencies: []

+ 0 - 54
roles/external/ansible-gluon-collector/tasks/main.yml

@@ -1,54 +0,0 @@
----
-# tasks file for ansible-gluon-collector
-
-- when: ansible_machine != "x86_64"
-  set_fact: gluon_collector_download_url="{{gluon_collector_download_url}}-386"
-
-- name: Create Group for gluon-collector 
-  group:
-    name: "{{gluon_collector_group}}"
-    state: present
-    system: yes
-
-- name: Create user for gluon-collector 
-  user: 
-    name: "{{gluon_collector_user}}" 
-    createhome: no 
-    home: "{{gluon_collector_base_path}}"
-    system: yes
-    state: present
-    groups: "{{gluon_collector_group}}"
-
-- name: Create install directory for gluon-collector 
-  file:
-    dest: "{{gluon_collector_base_path}}" 
-    state: directory 
-    owner: "{{gluon_collector_user}}"
-    group: "{{gluon_collector_group}}"
-
-- name: Create gluon-collector configuration
-  template: 
-    src: config.j2
-    dest: "{{gluon_collector_base_path}}/gluon-collector.yml"
-    owner: "{{gluon_collector_user}}"
-    group: "{{gluon_collector_group}}"
-    mode: "u=rw,g=rw,o=r"
-  notify: Restart gluon-collector
-
-- name: Download gluon-collector 
-  get_url:
-    dest: "{{gluon_collector_base_path}}/gluon-collector"
-    url: "{{gluon_collector_download_url}}"
-
-- name: Set permission on gluon-collector executable
-  file:
-    dest: "{{gluon_collector_base_path}}/gluon-collector"
-    owner: "{{gluon_collector_user}}"
-    group: "{{gluon_collector_group}}"
-    mode: "u=rwx,g=rw,o=r"
-
-- when: gluon_collector_use_supervisor
-  include: supervisor.yml
-
-- when: not gluon_collector_use_supervisor
-  include: systemd.yml

+ 0 - 16
roles/external/ansible-gluon-collector/tasks/supervisor.yml

@@ -1,16 +0,0 @@
----
-
-- name: Ensure supervisor is installed
-  apt:
-    name: supervisor
-    state: present
-
-- name: Install supervisor config
-  template:
-    src: supervisor.j2
-    dest: "{{gluon_collector_supervisor_config_path}}/gluon-collector.conf"
-
-- name: Ensure gluon-collector is enabled and started
-  supervisorctl:
-    name: gluon-collector
-    state: started

+ 0 - 12
roles/external/ansible-gluon-collector/tasks/systemd.yml

@@ -1,12 +0,0 @@
----
-
-- name: Generate systemd service
-  template:
-    src: systemd.j2
-    dest: /etc/systemd/system/gluon-collector.service
-
-- name: Ensure gluon-collector is started and enabled via systemd
-  service:
-    name: gluon-collector
-    state: started
-    enabled: yes

+ 0 - 25
roles/external/ansible-gluon-collector/templates/config.j2

@@ -1,25 +0,0 @@
-receiver: 
-{% for receiver in gluon_collector_receivers %}                
-- type: {{receiver.type}}        
-  interface: "{{receiver.interface}}"      
-  port: {{receiver.port}}       
-{% endfor %}
-
-interval:
-  statistics: {{gluon_collector_interval_statistics}}         
-  nodeinfo: {{gluon_collector_interval_nodeinfo}}          
-  expire: {{gluon_collector_interval_expire}}              
-
-logger:     
-  level: "{{gluon_collector_log_level}}"           
-  file: "{{gluon_collector_log_path}}"
-
-store:
-  type: "{{gluon_collector_store_type}}"            
-  path: "{{gluon_collector_db_path}}" 
-  expireNodesAfterDays: {{gluon_collector_expire_nodes}} 
-
-http:             
-  port: {{gluon_collector_http_port}}              
-  address: "{{gluon_collector_http_address}}"
-   

+ 0 - 11
roles/external/ansible-gluon-collector/templates/supervisor.j2

@@ -1,11 +0,0 @@
-[program:gluon-collector]
-command={{gluon_collector_base_path}}/gluon-collector -config {{gluon_collector_config_path}}
-autostart=true
-autorestart=true
-startretries=10
-user={{gluon_collector_user}}
-directory={{gluon_collector_base_path}}
-redirect_stderr=true
-stdout_logfile={{gluon_collector_log_path}}
-stdout_logfile_maxbytes=5MB
-stdout_logfile_backups=10

+ 0 - 11
roles/external/ansible-gluon-collector/templates/systemd.j2

@@ -1,11 +0,0 @@
-[Unit]
-Description=gluon-collector
-
-[Service]
-ExecStart={{gluon_collector_base_path}}/gluon-collector
-WorkingDirectory={{gluon_collector_base_path}}
-Restart=always
-User={{gluon_collector_user}}
-
-[Install]
-WantedBy=multi-user.target

+ 0 - 2
roles/external/ansible-gluon-collector/test/ansible.cfg

@@ -1,2 +0,0 @@
-[defaults]
-roles_path=../:../../:/spec/

+ 0 - 12
roles/external/ansible-gluon-collector/test/application/gluon-collector.yml

@@ -1,12 +0,0 @@
----
-- name         : Install and configure gluon-collector
-  hosts        : all
-  gather_facts : yes
-  vars         :
-    gluon_collector_receivers:
-    - type: announced
-      port: 12123
-      interface: eth0
-  connection   : "{{ kitchen_connection | default('local') }}"
-  roles        :
-                 - "ansible-gluon-collector"

+ 0 - 14
roles/external/ansible-gluon-collector/test/integration/gluon-collector/serverspec/collector_spec.rb

@@ -1,14 +0,0 @@
-require 'serverspec'
-
-# Required by serverspec
-set :backend, :exec
-
-describe file('/opt/gluon-collector') do
-  it { should be_directory }
-end
-
-describe file('/opt/gluon-collector/gluon-collector') do 
-  it { should exist }
-  it { should be_file }
-  it { should be_executable }
-end

+ 0 - 1
roles/external/ansible-gluon-collector/test/local.ini

@@ -1 +0,0 @@
-localhost ansible_connection='local'

+ 0 - 17
roles/external/ansible-gluon-collector/test/run_vagrant_kitchen.sh

@@ -1,17 +0,0 @@
-#!/usr/bin/env bash
-set -e
-echo "**** Box setup ***"
-
-echo "* mkdir /kitchen"
-mkdir -p /kitchen
-
-#echo "* cp -ar /mnt/shared /kitchen"
-#cp -r /mnt/shared/. /kitchen
-echo "* ln -sf /mnt/shared /kitchen"
-ln -sf /mnt/shared/* /kitchen/
-
-echo "* cd /kitchen"
-cd /kitchen/*
-
-echo "* python test/travis_run.py"
-python test/travis_run.py

+ 0 - 98
roles/external/ansible-gluon-collector/test/travis_run.py

@@ -1,98 +0,0 @@
-#!/usr/bin/env python
-# https://github.com/ahelal/travis-in-box
-
-import yaml
-import subprocess
-import sys
-import os.path
-
-
-class TravisExec(object):
-    def __init__(self, filename="travis.yml"):
-        self.fail = False
-        stream = open(filename, 'r')
-        yaml_file = yaml.load(stream)
-        # language
-        self.language = yaml_file.get("language", None)
-
-        # Section
-        self.section_before_install = yaml_file.get("before_install", None)
-        self.section_install = yaml_file.get("install", None)
-        self.section_before_script = yaml_file.get("before_script", None)
-        self.section_script = yaml_file.get("script", None)
-
-        #self.section_after_script = yaml_file.get("after_script", None)
-        self.section_after_failure = yaml_file.get("after_failure", None)
-        self.section_after_success = yaml_file.get("after_success", None)
-
-    def _setup(self):
-        if self.language == "python":
-            print "********** Setup Python  **********"
-            print ""
-            # Since we are not using container we have to install various lang our self
-            # So this is probably not the best way to do it
-            self._execute_command(["sudo apt-get install python-setuptools python-pip -y"])
-        else:
-            print "Errors unsupported language {}".format(self.language)
-            exit(1)
-
-    def life_cycle(self):
-        # See http://docs.travis-ci.com/user/build-configuration/
-
-            # 1. setup language
-            self._setup()
-            # 4. Run before_install commands
-            self.run_command("before_install", self.section_before_install, self.section_after_failure)
-            # 5. Run install commands
-            self.run_command("install", self.section_install, self.section_after_failure)
-            # 6. Run before_script commands
-            self.run_command("before_script", self.section_before_script, self.section_after_failure)
-            # 7. Run test script commands
-            self.run_command("script", self.section_script, self.section_after_failure)
-            # 8 . if we reach this point we made it run after_success
-            self.run_command("after_success", self.section_after_success, None)
-
-    @staticmethod
-    def _execute_command(command):
-        new_command = ["echo '> " + item.rstrip('\n') + "' && { " + item.rstrip('\n') + " ; }" for item in command]
-        new_command = " && ".join(new_command)
-
-        p = subprocess.Popen(new_command, shell=True, stderr=subprocess.PIPE)
-        while True:
-            out = p.stderr.read(1)
-            if out == '' and p.poll() is not None:
-                break
-            if out != '':
-                sys.stdout.write(out)
-                sys.stdout.flush()
-        print ""
-        return p.returncode
-
-    def run_command(self, section_name=None, command=None, execute_on_failure=None):
-        if command:
-            print ""
-            print "********** Running '{}' **********".format(section_name)
-            return_code = self._execute_command(command)
-            if return_code != 0:
-                print ""
-                print "********** Failed in '{}' **********".format(section_name)
-                if execute_on_failure:
-                    print ""
-                    print "********** Running after_failure  **********".format(section_name)
-                    self._execute_command(execute_on_failure)
-                    exit(1)
-
-filename = None
-if len(sys.argv) == 1:
-    filename = ".travis.yml"
-elif len(sys.argv) == 2:
-    filename = sys.argv[1]
-else:
-    print "Invalid number of arguments"
-    exit(1)
-
-if os.path.exists(filename):
-    TravisExec(filename).life_cycle()
-else:
-    print "Could not file travis file '{}'".format(filename)
-    exit(1)

+ 0 - 2
roles/external/ansible-gluon-collector/vars/main.yml

@@ -1,2 +0,0 @@
----
-# vars file for ansible-gluon-collector

+ 0 - 1
roles/internal/ffdo.meshviewer/meta/main.yml

@@ -50,5 +50,4 @@ galaxy_info:
   - monitoring
   - web
 dependencies:
-- ansible-gluon-collector
 - laggyluke.nodejs

+ 0 - 3
roles/thirdparty_roles.yml

@@ -7,9 +7,6 @@
 - src: dereulenspiegel.alfred
   version: v1.1
 
-- src: https://github.com/ffdo/ansible-gluon-collector.git
-  version: v1.0
-
 - src: dereulenspiegel.alfred-json
 
 - src: jdauphant.nginx