Commit 93bda248 by John Doe

puppet bug fixes

parent 594563b6
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
# Packages required by multiple modules # Packages required by multiple modules
# #
class common { class common {
$pkgs=['build-essential'] $pkgs=['build-essential']
package { $pkgs: package { $pkgs:
ensure => present ensure => present
} }
} }
...@@ -26,7 +26,8 @@ class joule { ...@@ -26,7 +26,8 @@ class joule {
exec{'install_joule': exec{'install_joule':
command => "${pip_cmd} joule", command => "${pip_cmd} joule",
timeout => 0, timeout => 0,
path => ["/usr/local/bin","/usr/bin"] path => ["/usr/local/bin","/usr/bin"],
require => Package[$deps]
} }
exec{'initialize_joule': exec{'initialize_joule':
command => "joule initialize", command => "joule initialize",
......
...@@ -11,10 +11,12 @@ ...@@ -11,10 +11,12 @@
# Copyright 2017 John Donnal, unless otherwise noted # Copyright 2017 John Donnal, unless otherwise noted
# #
class nilmdb { class nilmdb {
require 'common'
$pip_url="http://puppet:wX27zvbA@pypi.wattsworth.net:8080/" $pip_url="http://puppet:wX27zvbA@pypi.wattsworth.net:8080/"
$pip_cmd="pip2 install --extra-index-url ${pip_url}" $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-cherrypy3','python-decorator','python-requests',
'python-dateutil','python-tz','python-progressbar','python-psutil', 'python-dateutil','python-tz','python-progressbar','python-psutil',
'python-simplejson','apache2','libapache2-mod-wsgi'] 'python-simplejson','apache2','libapache2-mod-wsgi']
...@@ -26,7 +28,8 @@ class nilmdb { ...@@ -26,7 +28,8 @@ class nilmdb {
exec{'install_nilmdb': exec{'install_nilmdb':
command => "${pip_cmd} nilmdb nilmtools", command => "${pip_cmd} nilmdb nilmtools",
timeout => 0, timeout => 0,
path => ["/usr/local/bin","/usr/bin"] path => ["/usr/local/bin","/usr/bin"],
require => Package[$deps]
} }
user{'nilmdb': user{'nilmdb':
......
Facter.add('python_version') do Facter.add('python_version') do
setcode do setcode do
Facter::Core::Execution.exec('python3 -V') begin
Facter::Core::Execution.exec('python3 -V')
rescue
0 #not installed
end
end end
end end
...@@ -13,8 +13,7 @@ class python3::build { ...@@ -13,8 +13,7 @@ class python3::build {
"lzma-dev", "lzma-dev",
"libbz2-dev"] "libbz2-dev"]
package { 'prereqs': package { $build_deps:
name => $build_deps,
ensure => present ensure => present
} }
#get the source code #get the source code
...@@ -28,7 +27,7 @@ class python3::build { ...@@ -28,7 +27,7 @@ class python3::build {
command => "/bin/tar -xvf Python-3.5.2.tgz", command => "/bin/tar -xvf Python-3.5.2.tgz",
cwd => "/tmp", cwd => "/tmp",
creates => "/tmp/Python-3.5.2", creates => "/tmp/Python-3.5.2",
require => [Exec['wget_python'],Package['prereqs']] require => [Exec['wget_python'],Package[$build_deps]]
} }
#compile the code #compile the code
exec { 'compile_python': exec { 'compile_python':
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
# Copyright 2017 John Donnal, unless otherwise noted. # Copyright 2017 John Donnal, unless otherwise noted.
# #
class python3 { class python3 {
require common
if $::python_version != 'Python 3.5.2' { if $::python_version != 'Python 3.5.2' {
include python3::build include python3::build
} }
......
...@@ -5,3 +5,9 @@ node 'raspberrypi' { ...@@ -5,3 +5,9 @@ node 'raspberrypi' {
include nilmdb include nilmdb
include nilm 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