Merge remote-tracking branch 'upstream/master'

This commit is contained in:
stack72
2014-06-10 21:59:02 +01:00
6 changed files with 57 additions and 29 deletions

View File

@@ -30,7 +30,7 @@ Word of caution
Puppetboard is very, very young but it works fairly well. Puppetboard is very, very young but it works fairly well.
That being said a lot of the code is very exeprimental, just trying That being said a lot of the code is very experimental, just trying
to figure out what works and what not, what we need to do different to figure out what works and what not, what we need to do different
and what features we need on the PuppetDB side of things. and what features we need on the PuppetDB side of things.
@@ -66,30 +66,37 @@ Packages
^^^^^^^^ ^^^^^^^^
Native packages for your operating system will be provided in the near future. Native packages for your operating system will be provided in the near future.
+------------------+-----------+--------------------------------------------+ +-------------------+-----------+--------------------------------------------+
| OS | Status | | | OS | Status | |
+==================+===========+============================================+ +===================+===========+============================================+
| Debian 6/Squeeze | planned | Requires Backports | | Debian 6/Squeeze | planned | Requires Backports |
+------------------+-----------+--------------------------------------------+ +-------------------+-----------+--------------------------------------------+
| Debian 7/Wheezy | planned | | | Debian 7/Wheezy | planned | |
+------------------+-----------+--------------------------------------------+ +-------------------+-----------+--------------------------------------------+
| Ubuntu 13.04 | planned | | | Ubuntu 13.04 | planned | |
+------------------+-----------+--------------------------------------------+ +-------------------+-----------+--------------------------------------------+
| Ubuntu 13.10 | planned | | | Ubuntu 13.10 | planned | |
+------------------+-----------+--------------------------------------------+ +-------------------+-----------+--------------------------------------------+
| CentOS/RHEL 5 | n/a | Python 2.4 | | CentOS/RHEL 5 | n/a | Python 2.4 |
+------------------+-----------+--------------------------------------------+ +-------------------+-----------+--------------------------------------------+
| CentOS/RHEL 6 | planned | | | CentOS/RHEL 6 | planned | |
+------------------+-----------+--------------------------------------------+ +-------------------+-----------+--------------------------------------------+
| `ArchLinux`_ | available | Maintained by `Niels Abspoel`_ | | `OpenSuSE 12/13`_ | available | Maintained on `OpenSuSE Build Service`_ |
+------------------+-----------+--------------------------------------------+ +-------------------+-----------+--------------------------------------------+
| `OpenBSD`_ | available | Maintained by `Jasper Lievisse Adriaanse`_ | | `SuSE LE 11 SP3`_ | available | Maintained on `OpenSuSE Build Service`_ |
+------------------+-----------+--------------------------------------------+ +-------------------+-----------+--------------------------------------------+
| `ArchLinux`_ | available | Maintained by `Niels Abspoel`_ |
+-------------------+-----------+--------------------------------------------+
| `OpenBSD`_ | available | Maintained by `Jasper Lievisse Adriaanse`_ |
+-------------------+-----------+--------------------------------------------+
.. _ArchLinux: https://aur.archlinux.org/packages/python2-puppetboard/ .. _ArchLinux: https://aur.archlinux.org/packages/python2-puppetboard/
.. _Niels Abspoel: https://github.com/aboe76 .. _Niels Abspoel: https://github.com/aboe76
.. _Jasper Lievisse Adriaanse: https://github.com/jasperla .. _Jasper Lievisse Adriaanse: https://github.com/jasperla
.. _OpenBSD: http://www.openbsd.org/cgi-bin/cvsweb/ports/www/puppetboard/ .. _OpenBSD: http://www.openbsd.org/cgi-bin/cvsweb/ports/www/puppetboard/
.. _OpenSuSE Build Service: https://build.opensuse.org/package/show/systemsmanagement:puppet/python-puppetboard
.. _OpenSuSE 12/13: https://build.opensuse.org/package/show/systemsmanagement:puppet/python-puppetboard
.. _SuSE LE 11 SP3: https://build.opensuse.org/package/show/systemsmanagement:puppet/python-puppetboard
Development Development
@@ -273,7 +280,7 @@ Here is a sample configuration for Fedora:
Note the directory path, it's the path to where pip installed Puppetboard; X.Y Note the directory path, it's the path to where pip installed Puppetboard; X.Y
must be replaced with your python version. We also alias the ``/static`` path must be replaced with your python version. We also alias the ``/static`` path
so that Apache will serve the static files like the included CSS and Javascript. so that Apache will serve the static files like the included CSS and Javascript.
Apache + mod_passenger Apache + mod_passenger
@@ -393,7 +400,7 @@ Now we need to start uwsgi:
.. code-block:: bash .. code-block:: bash
$ uwsgi --http :9090 --wsgi-file /var/www/puppetboard/wsgi.py $ uwsgi --socket :9090 --wsgi-file /var/www/puppetboard/wsgi.py
Feel free to change the port to something other than ``9090``. Feel free to change the port to something other than ``9090``.
@@ -429,7 +436,7 @@ instead of the traditional ``proxy_pass``.
nginx + gunicorn nginx + gunicorn
^^^^^^^^^^^^^ ^^^^^^^^^^^^^
You can use gunicorn instead of uwsgi if you prefer, the process doesn't You can use gunicorn instead of uwsgi if you prefer, the process doesn't
differ too much. As we can't use ``uwsgi_pass`` with gunicorn, the nginx configuration file is going to differ a bit: differ too much. As we can't use ``uwsgi_pass`` with gunicorn, the nginx configuration file is going to differ a bit:
.. code-block:: nginx .. code-block:: nginx
@@ -442,11 +449,11 @@ differ too much. As we can't use ``uwsgi_pass`` with gunicorn, the nginx configu
listen 80; listen 80;
server_name puppetboard.example.tld; server_name puppetboard.example.tld;
charset utf-8; charset utf-8;
location /static { location /static {
alias /usr/local/lib/pythonX.Y/dist-packages/puppetboard/static; alias /usr/local/lib/pythonX.Y/dist-packages/puppetboard/static;
} }
location / { location / {
add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Origin *;
proxy_pass_header Server; proxy_pass_header Server;

View File

@@ -116,6 +116,7 @@ def index():
'unchanged': 0, 'unchanged': 0,
'failed': 0, 'failed': 0,
'unreported': 0, 'unreported': 0,
'noop': 0
} }
for node in nodes: for node in nodes:
@@ -125,6 +126,8 @@ def index():
stats['changed'] += 1 stats['changed'] += 1
elif node.status == 'failed': elif node.status == 'failed':
stats['failed'] += 1 stats['failed'] += 1
elif node.status == 'noop':
stats['noop'] += 1
else: else:
stats['unchanged'] += 1 stats['unchanged'] += 1

View File

@@ -8,5 +8,6 @@ DEV_LISTEN_HOST = '127.0.0.1'
DEV_LISTEN_PORT = 5000 DEV_LISTEN_PORT = 5000
UNRESPONSIVE_HOURS = 2 UNRESPONSIVE_HOURS = 2
ENABLE_QUERY = True ENABLE_QUERY = True
LOCALISE_TIMESTAMP = True
LOGLEVEL = 'info' LOGLEVEL = 'info'
REPORTS_COUNT = 10 REPORTS_COUNT = 10

View File

@@ -1,7 +1,7 @@
{% extends 'layout.html' %} {% extends 'layout.html' %}
{% block content %} {% block content %}
<div class="ui vertical grid"> <div class="ui vertical grid">
<div class="three column row"> <div class="four column row">
<div class="column"> <div class="column">
<a href="nodes?status=failed"> <a href="nodes?status=failed">
<h1 class="ui red header no-margin-bottom"> <h1 class="ui red header no-margin-bottom">
@@ -11,6 +11,15 @@
</a> </a>
<span>with status failed</span> <span>with status failed</span>
</div> </div>
<div class="column">
<a href="nodes?status=noop">
<h1 class="ui header purple no-margin-bottom">
{{stats['noop']}}
<small>{% if stats['noop']== 1 %} node {% else %} nodes {% endif %}</small>
</h1>
</a>
<span>with status pending</span>
</div>
<div class="column"> <div class="column">
<a href="nodes?status=changed"> <a href="nodes?status=changed">
<h1 class="ui header green no-margin-bottom"> <h1 class="ui header green no-margin-bottom">
@@ -30,7 +39,9 @@
<span>unreported in the last {{ config.UNRESPONSIVE_HOURS }} hours</span> <span>unreported in the last {{ config.UNRESPONSIVE_HOURS }} hours</span>
</div> </div>
</div> </div>
<div class="three column row"> <div class="four column row">
<div class="column">
</div>
<div class="column"> <div class="column">
<h1 class="ui header darkblue no-margin-bottom">{{metrics['num_nodes']}}</h1> <h1 class="ui header darkblue no-margin-bottom">{{metrics['num_nodes']}}</h1>
<span>Population</span> <span>Population</span>
@@ -70,6 +81,8 @@
green green
{% elif node.status == 'unreported' %} {% elif node.status == 'unreported' %}
black black
{% elif node.status == 'noop' %}
blue
{% endif %} {% endif %}
" href="{{url_for('report_latest', node_name=node.name)}}"> " href="{{url_for('report_latest', node_name=node.name)}}">
{{node.status}} {{node.status}}

View File

@@ -42,9 +42,11 @@
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/semantic-ui/0.12.0/javascript/semantic.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/semantic-ui/0.12.0/javascript/semantic.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.5.1/moment.min.js"></script> {% if config.LOCALISE_TIMESTAMP %}
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.5.1/moment.min.js"></script>
<script src="{{ url_for('static', filename='js/timestamps.js')}}"></script>
{% endif %}
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.13.3/jquery.tablesorter.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.13.3/jquery.tablesorter.min.js"></script>
<script src="{{ url_for('static', filename='js/timestamps.js')}}"></script>
<script src="{{url_for('static', filename='js/lists.js')}}"></script> <script src="{{url_for('static', filename='js/lists.js')}}"></script>
<script src="{{url_for('static', filename='js/tables.js')}}"></script> <script src="{{url_for('static', filename='js/tables.js')}}"></script>

View File

@@ -24,6 +24,8 @@
green green
{% elif node.status == 'unreported' %} {% elif node.status == 'unreported' %}
black black
{% elif node.status == 'noop' %}
blue
{% endif %} {% endif %}
" href="{{url_for('report_latest', node_name=node.name)}}"> " href="{{url_for('report_latest', node_name=node.name)}}">
{{node.status}} {{node.status}}