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
4d23b468
authored
Nov 15, 2019
by
source_reader
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
more bug fixes
parent
598027de
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
19 additions
and
82 deletions
modules/common/manifests/init.pp
modules/first_boot/files/pi/NETWORK_README → modules/docs/files/NETWORK_README
modules/first_boot/files/README → modules/docs/files/README
modules/first_boot/files/STORAGE_README → modules/docs/files/STORAGE_README
modules/docs/manifests/init.pp
modules/first_boot/manifests/init.pp
modules/first_boot/files/first_boot.sh → modules/first_boot/templates/first_boot.sh.erb
modules/hostapd/manifests/config.pp
modules/hostapd/manifests/install.pp
modules/hostapd/manifests/service.pp
modules/nginx/files/nilmdb.conf
modules/nginx/manifests/config.pp
modules/nginx/manifests/service.pp
modules/nilmdb/manifests/config.pp
site.pp
modules/common/manifests/init.pp
View file @
4d23b468
...
...
@@ -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'
}
}
}
modules/
first_boot/files/pi
/NETWORK_README
→
modules/
docs/files
/NETWORK_README
View file @
4d23b468
File moved
modules/
first_boot
/files/README
→
modules/
docs
/files/README
View file @
4d23b468
File moved
modules/
first_boot
/files/STORAGE_README
→
modules/
docs
/files/STORAGE_README
View file @
4d23b468
File moved
modules/docs/manifests/init.pp
View file @
4d23b468
...
...
@@ -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'
}
...
...
modules/first_boot/manifests/init.pp
View file @
4d23b468
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
,
...
...
modules/first_boot/
files/first_boot.sh
→
modules/first_boot/
templates/first_boot.sh.erb
View file @
4d23b468
...
...
@@ -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"
...
...
modules/hostapd/manifests/config.pp
View file @
4d23b468
class
hostapd::config
{
notice
(
"including hostapd config"
)
if
$facts
[
'platform'
]
==
'rpi'
{
file
{
'/etc/hostapd/hostapd.conf'
:
owner
=>
root
,
...
...
modules/hostapd/manifests/install.pp
View file @
4d23b468
class
hostapd::install
{
notice
(
"including hostapd install"
)
package
{
'hostapd'
:
ensure
=>
present
}
...
...
modules/hostapd/manifests/service.pp
View file @
4d23b468
class
hostapd::service
{
notice
(
"including hostapd service"
)
# disable both services
service
{
'hostapd'
:
enable
=>
false
,
...
...
modules/nginx/files/nilmdb.conf
View file @
4d23b468
location
/
nilmdb
{
include
uwsgi_params
;
uwsgi_pass
unix
:/
tmp
/
nilmdb
.
sock
uwsgi_pass
unix
:/
tmp
/
nilmdb
.
sock
;
}
\ No newline at end of file
modules/nginx/manifests/config.pp
View file @
4d23b468
...
...
@@ -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
,
...
...
modules/nginx/manifests/service.pp
View file @
4d23b468
...
...
@@ -2,5 +2,6 @@ class nginx::service{
service
{
'nginx'
:
enable
=>
true
,
ensure
=>
running
}
}
modules/nilmdb/manifests/config.pp
View file @
4d23b468
class
nilmdb::config
{
file
{
'/etc/nilmdb.ini'
:
file
{
'/etc/nilmdb
/nilmdb
.ini'
:
source
=>
"puppet:///modules/nilmdb/nilmdb.ini"
,
owner
=>
root
,
group
=>
root
,
...
...
site.pp
View file @
4d23b468
...
...
@@ -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
...
...
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