Commit 4d23b468 by source_reader

more bug fixes

parent 598027de
......@@ -11,72 +11,4 @@ class common {
package { $pkgs:
ensure => present
}
# Set up files on the Ubuntu Desktop (through /etc/skel)
if $facts['platform'] == 'ubuntu'{
file {'/etc/skel/Desktop':
ensure => directory,
}
file {'/etc/skel/Desktop/README':
ensure => present,
source => 'puppet:///modules/common/README'
}
vcsrepo{'/etc/skel/Desktop/example_modules':
ensure => latest,
provider => git,
source => 'https://github.com/wattsworth/example-modules.git'
}
file{'/etc/skel/Desktop/STORAGE_README':
ensure => present,
source => 'puppet:///modules/common/STORAGE_README'
}
}
# set up files on Pi (directly to /home/pi)
else {
file { '/etc/profile.d/first_boot.sh':
ensure => present,
owner => root,
group => root,
mode => '0755',
source => 'puppet:///modules/common/pi/first_boot_sh_notify.sh'
}
file {'/home/pi/Desktop/README':
ensure => present,
owner => pi,
group => pi,
source => 'puppet:///modules/common/README'
}
file{'/home/pi/Desktop/STORAGE_README':
ensure => present,
owner => pi,
group => pi,
source => 'puppet:///modules/common/STORAGE_README'
}
file{'/home/pi/Desktop/NETWORK_README':
ensure => present,
owner => pi,
group => pi,
source => 'puppet:///modules/common/pi/NETWORK_README'
}
vcsrepo{'/home/pi/Desktop/example_modules':
ensure => latest,
provider => git,
source => 'https://github.com/wattsworth/example-modules.git'
}
file {'/etc/xdg/lxsession/LXDE-pi/autostart':
ensure => present,
owner => root,
group => root,
mode => '0755',
source => 'puppet:///modules/common/pi/autostart_xdg'
}
file {'/usr/local/bin/first_boot_gui_notify':
ensure => present,
owner => root,
group => root,
mode => '0755',
source => 'puppet:///modules/common/pi/first_boot_gui_notify.sh'
}
}
}
......@@ -10,32 +10,32 @@ class docs {
$docs_path = '/home/pi/Desktop'
$owner = "pi"
# also include the NETWORK README
file {"#{$docs_path}/NETWORK_README":
file {"${docs_path}/NETWORK_README":
ensure => present,
owner => $owner,
group => $owner,
source => 'puppet:///modules/docs/pi/NETWORK_README'
source => 'puppet:///modules/docs/NETWORK_README'
}
}
file {"#{$docs_path}/README"}:
file {"${docs_path}/README":
ensure => present,
owner => $owner,
group => $owner,
source => 'puppet:///modules/docs/README'
}
vcsrepo{"#{$docs_path}/example_modules":
vcsrepo{"${docs_path}/example_modules":
ensure => latest,
provider => git,
owner => $owner,
group => $owner,
source => 'https://github.com/wattsworth/example-modules.git'
}
file{"#{$docs_path}/STORAGE_README":
file{"${docs_path}/STORAGE_README":
ensure => present,
owner => $owner,
group => $group
group => $owner,
source => 'puppet:///modules/docs/STORAGE_README'
}
......
class first_boot {
# first boot initialization scripts
if $facts['image_type']=='nilm'{
$nilmdb = true
} else {
$nilmdb = false
}
file {'/usr/local/bin/first_boot':
ensure => present,
owner => root,
group => root,
mode => '0755',
source => 'puppet:///modules/first_boot/first_boot.sh'
content => template('first_boot/first_boot.sh.erb')
}
file { '/etc/systemd/system/first_boot.service':
ensure => present,
......
......@@ -29,7 +29,7 @@ RAILS_PWD="$(openssl rand -hex 8)"
JOULE_PWD="$(openssl rand -hex 8)"
service joule stop
rm -f /etc/joule/main.conf
joule admin initialize --dsn joule:$JOULE_PWD@localhost:5432/joule
joule admin initialize --dsn joule:$JOULE_PWD@localhost:5432/joule <% if @nilmdb %> --nilmdb http://localhost/nilmdb <% end %>
echo "# Generating Rails secrets"
......
class hostapd::config{
notice("including hostapd config")
if $facts['platform'] == 'rpi'{
file {'/etc/hostapd/hostapd.conf':
owner => root,
......
class hostapd::install{
notice("including hostapd install")
package{'hostapd':
ensure => present
}
......
class hostapd::service{
notice("including hostapd service")
# disable both services
service{'hostapd':
enable => false,
......
location /nilmdb {
include uwsgi_params;
uwsgi_pass unix:/tmp/nilmdb.sock
uwsgi_pass unix:/tmp/nilmdb.sock;
}
\ No newline at end of file
......@@ -2,7 +2,6 @@ class nginx::config{
if $facts['image_type']=='nilm'{
$nilmdb = true
notice("nilmdb is true!")
file {'/etc/nginx/nilmdb.conf':
source => 'puppet:///modules/nginx/nilmdb.conf',
owner => root,
......
......@@ -2,5 +2,6 @@ class nginx::service{
service {'nginx':
enable => true,
ensure => running
}
}
class nilmdb::config{
file{'/etc/nilmdb.ini':
file{'/etc/nilmdb/nilmdb.ini':
source => "puppet:///modules/nilmdb/nilmdb.ini",
owner => root,
group => root,
......
......@@ -6,6 +6,8 @@ node 'default' {
include hostapd
include joule
include nginx
include docs
include first_boot
if($facts['image_type']=='nilm') {
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