Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
wattsworth
/
puppet
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a54d93b1
authored
Apr 28, 2017
by
source_reader
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
added nilmdb configuration
parent
ef9c6099
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
86 additions
and
30 deletions
modules/joule/manifests/init.pp
modules/nilmdb/files/10-nilmdb.conf
modules/nilmdb/files/nilmdb.wsgi
modules/nilmdb/manifests/init.pp
site.pp
modules/joule/manifests/init.pp
View file @
a54d93b1
...
...
@@ -38,8 +38,8 @@
class
joule
{
$pip_url
=
"http://
nuc.office
:8080/"
$pip_cmd
=
"pip3 install --extra-index-url
${pip_url}
--trusted-host
nuc.office
"
$pip_url
=
"http://
puppet:wX27zvbA@pypi.wattsworth.net
:8080/"
$pip_cmd
=
"pip3 install --extra-index-url
${pip_url}
--trusted-host
pypi.wattsworth.net
"
$deps
=
[
'libblas-dev'
,
'liblapack-dev'
,
'gfortran'
]
...
...
modules/nilmdb/files/10-nilmdb.conf
0 → 100644
View file @
a54d93b1
<
VirtualHost
*:
80
>
WSGIScriptAlias
/
nilmdb
/
opt
/
data
/
nilmdb
.
wsgi
WSGIDaemonProcess
nilmdb
-
procgroup
threads
=
32
user
=
nilmdb
group
=
nilmdb
<
Location
/
nilmdb
>
WSGIProcessGroup
nilmdb
-
procgroup
WSGIApplicationGroup
nilmdb
-
appgroup
Require
all
granted
</
Location
>
ErrorLog
${
APACHE_LOG_DIR
}/
nilmdb_error
.
log
CustomLog
${
APACHE_LOG_DIR
}/
nilmdb_access
.
log
combined
</
VirtualHost
>
\ No newline at end of file
modules/nilmdb/files/nilmdb.wsgi
0 → 100644
View file @
a54d93b1
import nilmdb.server
application = nilmdb.server.wsgi_application("/opt/data","/nilmdb")
modules/nilmdb/manifests/init.pp
View file @
a54d93b1
# == Class: nilmdb
#
# Full description of class nilmdb here.
#
# === Parameters
#
# Document parameters here.
#
# [*sample_parameter*]
# Explanation of what this parameter affects and what it defaults to.
# e.g. "Specify one or more upstream ntp servers as an array."
#
# === Variables
#
# Here you should define a list of variables that this module would require.
#
# [*sample_variable*]
# Explanation of how this variable affects the funtion of this class and if
# it has a default. e.g. "The parameter enc_ntp_servers must be set by the
# External Node Classifier as a comma separated list of hostnames." (Note,
# global variables should be avoided in favor of class parameters as
# of Puppet 2.6.)
#
# === Examples
#
# class { 'nilmdb':
# servers => [ 'pool.ntp.org', 'ntp.local.company.com' ],
# }
# Install nilmdb and nilmtools
#
# === Authors
#
#
Author Name <author@domain.com>
#
John Donnal donnal@usna.edu
#
# === Copyright
#
# Copyright 2017
Your name here, unless otherwise noted.
# Copyright 2017
John Donnal, unless otherwise noted
#
class
nilmdb
{
$pip_url
=
"http://puppet:wX27zvbA@pypi.wattsworth.net:8080/"
$pip_cmd
=
"pip2 install --extra-index-url
${pip_url}
"
$deps
=
[
'cython'
,
'build-essential'
,
'python2.7'
,
'python2.7-dev'
,
'python-setuptools'
,
'python-pip'
,
'python-cherrypy3'
,
'python-decorator'
,
'python-requests'
,
'python-dateutil'
,
'python-tz'
,
'python-progressbar'
,
'python-psutil'
,
'python-simplejson'
,
'apache2'
,
'libapache2-mod-wsgi'
]
package
{
$deps
:
ensure
=>
present
,
before
=>
Exec
[
'install_nilmdb'
]
}
exec
{
'install_nilmdb'
:
command
=>
"
${pip_cmd}
nilmdb nilmtools"
,
timeout
=>
0
,
path
=>
[
"/usr/local/bin"
,
"/usr/bin"
]
}
user
{
'nilmdb'
:
ensure
=>
present
,
system
=>
true
}
file
{
'/etc/apache2/sites-available/10-nilmdb.conf'
:
source
=>
'puppet:///modules/nilmdb/10-nilmdb.conf'
,
owner
=>
root
,
group
=>
root
,
mode
=>
644
}
exec
{
'a2ensite 10-nilmdb.conf'
:
creates
=>
'/etc/apache2/sites-enabled/10-nilmdb.conf'
,
path
=>
[
'/usr/sbin'
,
'/usr/bin'
],
subscribe
=>
File
[
'/etc/apache2/sites-available/10-nilmdb.conf'
],
notify
=>
Exec
[
'apache2ctl restart'
]
}
file
{
'/etc/apache2/sites-enabled/000-default.conf'
:
ensure
=>
absent
,
notify
=>
Exec
[
'apache2ctl restart'
]
}
exec
{
'apache2ctl restart'
:
path
=>
[
'/usr/sbin'
,
'/usr/bin'
],
refreshonly
=>
true
,
}
file
{
'/opt/data'
:
ensure
=>
directory
,
owner
=>
nilmdb
,
group
=>
nilmdb
,
require
=>
User
[
'nilmdb'
]
}
file
{
'/opt/data/nilmdb.wsgi'
:
ensure
=>
present
,
owner
=>
nilmdb
,
group
=>
nilmdb
,
mode
=>
644
,
source
=>
'puppet:///modules/nilmdb/nilmdb.wsgi'
,
require
=>
User
[
'nilmdb'
],
notify
=>
Exec
[
'apache2ctl restart'
]
}
#mod_wsgi tries to access user home directory
#nilmdb is a system account but just create a stub
#directory to satisfy wsgi :P
file
{
'/home/nilmdb'
:
ensure
=>
directory
,
owner
=>
nilmdb
,
group
=>
nilmdb
,
notify
=>
Exec
[
'apache2ctl restart'
]
}
}
site.pp
View file @
a54d93b1
...
...
@@ -2,4 +2,5 @@ node 'raspberrypi' {
include
python3
include
joule
include
raspi
include
nilmdb
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment