Commit 93bda248 by John Doe

puppet bug fixes

parent 594563b6
......@@ -3,10 +3,10 @@
# Packages required by multiple modules
#
class common {
$pkgs=['build-essential']
package { $pkgs:
ensure => present
}
}
$pkgs=['build-essential']
package { $pkgs:
ensure => present
}
}
......@@ -26,7 +26,8 @@ class joule {
exec{'install_joule':
command => "${pip_cmd} joule",
timeout => 0,
path => ["/usr/local/bin","/usr/bin"]
path => ["/usr/local/bin","/usr/bin"],
require => Package[$deps]
}
exec{'initialize_joule':
command => "joule initialize",
......
......@@ -11,10 +11,12 @@
# Copyright 2017 John Donnal, unless otherwise noted
#
class nilmdb {
require 'common'
$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',
$deps = ['cython','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']
......@@ -26,7 +28,8 @@ class nilmdb {
exec{'install_nilmdb':
command => "${pip_cmd} nilmdb nilmtools",
timeout => 0,
path => ["/usr/local/bin","/usr/bin"]
path => ["/usr/local/bin","/usr/bin"],
require => Package[$deps]
}
user{'nilmdb':
......
Facter.add('python_version') do
setcode do
Facter::Core::Execution.exec('python3 -V')
begin
Facter::Core::Execution.exec('python3 -V')
rescue
0 #not installed
end
end
end
......@@ -13,8 +13,7 @@ class python3::build {
"lzma-dev",
"libbz2-dev"]
package { 'prereqs':
name => $build_deps,
package { $build_deps:
ensure => present
}
#get the source code
......@@ -28,7 +27,7 @@ class python3::build {
command => "/bin/tar -xvf Python-3.5.2.tgz",
cwd => "/tmp",
creates => "/tmp/Python-3.5.2",
require => [Exec['wget_python'],Package['prereqs']]
require => [Exec['wget_python'],Package[$build_deps]]
}
#compile the code
exec { 'compile_python':
......
......@@ -17,6 +17,7 @@
# Copyright 2017 John Donnal, unless otherwise noted.
#
class python3 {
require common
if $::python_version != 'Python 3.5.2' {
include python3::build
}
......
......@@ -5,3 +5,9 @@ node 'raspberrypi' {
include nilmdb
include nilm
}
node 'default' {
include python3
include joule
include nilmdb
include nilm
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment