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
44727d4b
authored
Jul 26, 2019
by
source_reader
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
bug fixes and updates
parent
572795a8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
25 deletions
bootstrap.sh
modules/static_sites/manifests/init.pp
rpi_bootstrap.sh
rpi_cleanup.sh
bootstrap.sh
View file @
44727d4b
...
...
@@ -13,9 +13,10 @@ add-apt-repository universe
apt-get update
apt install puppet-agent git r10k
-y
pip3 install
--upgrade
pip
# create the ubuntu user for
the livecd
#
adduser ubuntu --quiet --disabled-password --gecos ""
#
echo -e 'ubuntu\nubuntu\n' | passwd ubuntu
#
adduser ubuntu sudo
#
adduser ubuntu dialout
# create the ubuntu user for
logging into container, remove when done
adduser ubuntu
--quiet
--disabled-password
--gecos
""
echo
-e
'ubuntu\nubuntu\n'
| passwd ubuntu
adduser ubuntu
sudo
adduser ubuntu dialout
modules/static_sites/manifests/init.pp
View file @
44727d4b
...
...
@@ -28,7 +28,7 @@ class static_sites {
require
=>
File
[
'/var/www/frontend'
]
}
file
{
'/etc/apache2/conf-enabled/passenger_prestart.conf
;
:
file
{
'/etc/apache2/conf-enabled/passenger_prestart.conf
'
:
source
=>
'puppet:///modules/static_sites/passenger_prestart.conf'
,
owner
=>
root
,
group
=>
root
,
...
...
rpi_bootstrap.sh
View file @
44727d4b
...
...
@@ -15,7 +15,7 @@ apt-get upgrade -y
apt install puppet git r10k
-y
# install postgres and timescale
apt install postgres
libpq-dev postgresql-server-dev-11 libssl-dev clang-format
apt install postgres
ql libpq-dev postgresql-server-dev-11 libssl-dev clang-format cmake
-y
git clone https://github.com/timescale/timescaledb.git
cd
timescaledb
git checkout 1.4.0
...
...
rpi_cleanup.sh
View file @
44727d4b
...
...
@@ -10,26 +10,14 @@ sudo -u postgres psql <<END_OF_SQL
DROP DATABASE joule;
DROP DATABASE rails;
END_OF_SQL
echo
"
3
] Erasing module and stream configurations"
echo
"
2
] Erasing module and stream configurations"
rm
-f
/etc/joule/module_configs/
*
.conf
rm
-f
/etc/joule/stream_configs/
*
.conf
echo
"
4
] Removing default key material"
echo
"
3
] Removing default key material"
rm
-f
/etc/joule/security/
*
rm
-f
/opt/api/config/secrets.yml
echo
"5] Reverting apt sources"
cat
>
/etc/apt/sources.list
<<
EOF
deb http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi
EOF
cat
>
/etc/apt/sources.list.d/raspi.list
<<
EOF
deb http://archive.raspberrypi.org/debian/ stretch main ui
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspberrypi.org/debian/ stretch main ui
EOF
apt update
apt upgrade
-y
echo
"6] Configuring root fs resize for first boot"
echo
"4] Configuring root fs resize for first boot"
PARTUUID
=
"
$(
blkid
-o
export
/dev/mmcblk0p2 |
grep
PARTUUID
)
"
cat
>
/boot/cmdline.txt
<<
EOF
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=
$PARTUUID
rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet init=/usr/lib/raspi-config/init_resize.sh splash plymouth.ignore-serial-consoles
...
...
@@ -66,12 +54,12 @@ EOF
chmod +x /etc/init.d/resize2fs_once
systemctl
enable
resize2fs_once
echo
"
7
] Cleanup home directory"
echo
"
5
] Cleanup home directory"
cd
/home/pi
ls
-A
|
grep
^
'\.'
|
grep
-Ev
".bashrc|.bash_logout|.local|.profile"
| xargs rm
-rf
cd
/root
ls
-A
|
grep
^
'\.'
|
grep
-Ev
".bashrc|.profile|.vnc"
| xargs rm
-rf
echo
"
8
] Enabling piwiz"
echo
"
6
] Enabling piwiz"
cat
>
/etc/xdg/autostart/piwiz.desktop
<<
EOF
[Desktop Entry]
Type=Application
...
...
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