Commit 616e98bb by source_reader

modified cleanup script for rpi

parent 20657e5b
......@@ -21,18 +21,6 @@ class apache {
refreshonly => true
}
package{'libapache2-mod-passenger':
ensure => present,
require => Exec['add-repo'],
notify => Exec['enable-passenger']
}
exec{'enable-passenger':
command => '/usr/sbin/a2enmod passenger',
require => Package['libapache2-mod-passenger'],
refreshonly => true,
notify => Exec['apache2ctl restart']
}
} else {
exec{ 'install-keys':
......@@ -43,10 +31,23 @@ class apache {
command => '/bin/true',
refreshonly => true
}
notice("omitting passenger key and repository on rpi platform")
notice("omitting passenger key and repo on rpi platform")
}
package{'libapache2-mod-passenger':
ensure => present,
require => Exec['add-repo'],
notify => Exec['enable-passenger']
}
exec{'enable-passenger':
command => '/usr/sbin/a2enmod passenger',
require => Package['libapache2-mod-passenger'],
refreshonly => true,
notify => Exec['apache2ctl restart']
}
package {$https_pkgs:
ensure => present,
require => Exec['install-keys'],
......@@ -63,7 +64,7 @@ class apache {
}
exec{'apache2ctl restart':
path => ['/usr/sbin','/usr/bin'],
require => Package[$deps],
require => Exec['enable-passenger', 'enable-rewrite-engine'],
refreshonly => true,
}
......
......@@ -27,7 +27,7 @@ class joule {
$dsn = 'joule:joule@localhost:5432/joule'
exec{'initialize_joule':
command => "joule initialize --dsn=${dsn}",
command => "joule admin initialize --dsn=${dsn}",
path => ['/usr/local/bin','/usr/sbin','/bin'],
creates => '/etc/joule/main.conf',
require => Exec['install_joule',
......
......@@ -25,7 +25,7 @@ class python {
'python-setuptools','python-cherrypy3','python-decorator',
'python-requests','python3-dev','python-dateutil',
'python-tz','python-progressbar','python-psutil',
'python-simplejson','python3-tk','python-tk']
'python-simplejson','python3-tk','python-tk','libffi-dev']
package{$deps:
ensure => present
......
#!/bin/bash
set -e
echo "stopping joule and lumen"
service joule stop
apache2ctl stop
echo "1] Remove the databases"
sudo -u postgres psql <<END_OF_SQL
DROP DATABASE joule;
DROP DATABASE rails;
END_OF_SQL
echo "3] 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"
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
echo "6] Configuring root fs resize for first boot"
cat > /boot/cmdline.txt <<EOF
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=025ce4e3-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet init=/usr/lib/raspi-config/init_resize.sh splash plymouth.ignore-serial-consoles
EOF
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