Git Product home page Git Product logo

ansible-graphite's Introduction

nsg.graphite

Build Status

This role installs graphite, I choose to install graphite from pip because the packages in the distributions repositories are old and features are missing. I’m using apt/yum when possible.

Galaxy

The Role in Ansible Galaxy is old and unmaintained because invasive permissions asked by Ansible.

Requirements

As usual, read the tasks and make sure this role will not breaks your installation, I will for example mess with django, twisted and uwsgi.

This role exposes the graphite web interface with uwsgi at localhost:3031, you need to configure a web server your self to talk to that. For example, do this with nginx:

server {
  listen 8080;
  charset utf-8;
  access_log /var/log/nginx/graphite.access.log;
  error_log /var/log/nginx/graphite.error.log;

  location /static {
    alias /opt/graphite/webapp/content;
    expires max;
  }

  location / {
    include uwsgi_params;
    uwsgi_pass 127.0.0.1:3031;
  }
}

The uwsgi socket can be configured through uwsgi_graphite_socket.

Alternatively, you can define uwsgi_graphite_extraopts with additional uwsgi configuration, which can e.g. enable http on port 8080 or add basic auth:

uwsgi_graphite_extraopts:
  - option: http
    value: "{{ ansible_default_ipv4.address }}:8080"
  - option: plugins
    value: router_basicauth
  - option: route
    value: "^/ basicauth:myRealm,foo:bar"

Role Variables

See: defaults/main.yml

Supported Graphite versions

1.0.2 and 1.1.3, choose version with graphite_install_version.

Example Playbook

    - hosts: servers
      roles:
         - role: nsg.graphite
           graphite_secret_key: 'dgdgdfgasg'
           graphite_cache_graphite_url: 'http://127.0.0.1:8080'

License

MIT

Author Information

Stefan Berggren, [email protected]

ansible-graphite's People

Contributors

devjatkin avatar duologic avatar martinnowak avatar mtekel avatar nsg avatar rhenning avatar teadur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ansible-graphite's Issues

sudo: a password is required - django-admin.py inspectdb

Running on Centos 7

$  ansible --version
ansible 2.7.1
  python version = 2.7.10 (default, Aug 17 2018, 17:41:52) [GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.0.42)]
fatal:
  [charts]:
    FAILED! => {
      "changed": false,
      ` "module_stderr": "Shared connection to <ipaddress> closed.\r\n",
      "module_stdout": "\u001b]0;c7h-template.cbase.ecm\u0007sudo: a password is required\r\n",
      "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
      "rc": 1
    }

When running this part of django-admin.yml

- name: django-admin.py - Inspect graphite db
  command: django-admin.py inspectdb
  environment:
    DJANGO_SETTINGS_MODULE: graphite.settings
    PYTHONPATH: "{{ graphite_install_path}}/webapp/"
  become: true
  become_user: "{{ graphite_user }}"
  register: result
  changed_when: false

Any tips appreciated,
Chris.

The name org.freedesktop.PolicyKit1 was not provided by any .service files

Trying to include graphite as a dependency results in:

$ sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm systemctl status uwsgi.service -l

● uwsgi.service - LSB: Start uwsgi

   Loaded: loaded (/etc/rc.d/init.d/uwsgi)

   Active: failed (Result: exit-code) since Thu 2016-08-18 08:46:14 UTC; 58s ago

     Docs: man:systemd-sysv-generator(8)

  Process: 3416 ExecStart=/etc/rc.d/init.d/uwsgi start (code=exited, status=1/FAILURE)

Aug 18 08:46:14 f659bab35d6d systemd[1]: Starting LSB: Start uwsgi...

Aug 18 08:46:14 f659bab35d6d sudo[3421]:     root : TTY=unknown ; PWD=/ ; USER=graphite ; COMMAND=/etc/rc.d/init.d/uwsgi start 2nd

Aug 18 08:46:14 f659bab35d6d uwsgi[3416]: Starting uwsgi (via systemctl):  Failed to start uwsgi.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files

Aug 18 08:46:14 f659bab35d6d uwsgi[3416]: [FAILED]

Aug 18 08:46:14 f659bab35d6d systemd[1]: uwsgi.service: control process exited, code=exited status=1

Aug 18 08:46:14 f659bab35d6d systemd[1]: Failed to start LSB: Start uwsgi.

Aug 18 08:46:14 f659bab35d6d systemd[1]: Unit uwsgi.service entered failed state.

Aug 18 08:46:14 f659bab35d6d systemd[1]: uwsgi.service failed.

New release required for ansible galaxy

Hi, any change you can make a new tag so it is picked up in ansible galaxy? at the moment I am using the repo rather than ansible-galaxy

Thanks in advance, and keep up the good work! :)

Problem with ansible 2 and uwsgi

Did a fresh install on Debian 8.3 on DO with latest Ansible and got a internal server error in the browser. If I do a identical install but use the good old version 1.9 everything works. Investigate.


---

- hosts: all
  roles:
    - role: ansible-graphite
      graphite_secret_key: 'dgdgdfgasg'
      uwsgi_graphite_extraopts:
        - option: http
          value: "{{ ansible_default_ipv4.address }}:8080"

[DEPRECATION WARNING]: Using bare variables is deprecated. Update your playbooks

[DEPRECATION WARNING]: Using bare variables is deprecated. Update your playbooks

 so that the environment value uses the full variable syntax 

('{{graphite_install_requirements[graphite_install_version]}}').

This feature 

will be removed in a future release. Deprecation warnings can be disabled by 

setting deprecation_warnings=False in ansible.cfg.

Move vars/main.yml to defaults

Hi,

I'm trying to install a different graphite version but when adding the version to graphite_install_requirements it get's overridden by the var defined in vars/main.yml.

Am I missing a way to add the requirements to that variable or somehow override it with my own variable?

I currently set the following in the group_vars named graphite:

graphite_install_version: 1.0.2
graphite_install_requirements:
  1.0.2:
    - Django==1.11
    - django-tagging==0.4.3
    - cairocffi==0.8.0
    - pytz==2017.2
    - scandir=1.5
    - python-memcached==1.47
    - txAMQP==0.6.2
    - gunicorn==19.7.0

But when running the role with the following inventory:

- hosts: graphite
  roles:
    - role: nsg.graphite

The variable graphite_install_requirements during runtime is (i've added a debug var statement to the role):

TASK [nsg.graphite : debug] ****************************************************
ok: [192.168.50.2] => {
    "graphite_install_requirements": {
        "0.9.15": [
            "Django==1.4",
            "python-memcached==1.47",
            "txAMQP==0.4",
            "simplejson==2.1.6",
            "django-tagging==0.3.1",
            "gunicorn==19.6.0",
            "pytz==2016.7",
            "cairocffi==0.7.2",
            "whisper==0.9.13",
            "whitenoise==3.2.2",
            "graphite-web==0.9.15",
            "carbon==0.9.15"
        ]
    }
}

Hope you can help me with this

Instead of sudo/sudo_user, use become/become_user and

[DEPRECATION WARNING]: Instead of sudo/sudo_user, use become/become_user and 

make sure become_method is 'sudo' (default).

This feature will be removed in a 

future release. Deprecation warnings can be disabled by setting 

deprecation_warnings=False in ansible.cfg.

systemctl: not found

I am trying to install graphite using your role on Debian Jessie.
I am using defaults for most options except user and passwords.
Here is the error I get from the Relaod systemd if unit file has changed:

TASK [nsg.graphite : Reload systemd if unit file has changed] ******************
fatal: [monitoring.curuba.fr]: FAILED!
{"changed": true, "cmd": "systemctl daemon-reload", 
"delta": "0:00:00.001284", 
"end": "2016-04-04 09:34:38.225001",
"failed": true, 
"rc": 127, 
"start": "2016-04-04 09:34:38.223717", 
"stderr": "/bin/sh: 1: systemctl: not found", 
"stdout": "", 
"stdout_lines": [], 
"warnings": []

Any idea?

Thanks in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.