Commit 2a0ce404 by John Donnal

updated Ubuntu first boot files

parent e1197b2d
......@@ -17,4 +17,4 @@ echo "4] Removing default key material"
rm -f /etc/joule/security/*
rm -f /opt/api/config/secrets.yml
echo "Remember to remove ubuntu user!"
......@@ -11,16 +11,24 @@ if [[ ! -p $pipe ]]; then
mkfifo $pipe
fi
# set the locale if empty
if [ -z "$LC_ALL"]; then
export LC_ALL=C.UTF-8
fi
if [ -z "$LANG"]; then
export LANG=C.UTF-8
fi
(
echo "# Generating Encryption Keys"
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
service joule restart
echo "# Generating Rails secrets"
cd /opt/api
......@@ -69,3 +77,4 @@ sleep 1
) | cat > $pipe
systemctl disable first_boot.service
service joule start
pipe=/tmp/first_boot_status
if [[ -p $pipe ]]; then
echo "*** Wattsworth is initializing, run [first_boot_status] to monitor the progress ***"
fi
pipe=/tmp/first_boot_status
if [[ ! -p $pipe ]]; then
echo "Wattsworth is initialized, the system is ready"
exit 0
fi
echo "tracking progress [^C to exit]:"
cat $pipe | grep "^#"
[Desktop Entry]
Type=Application
Name=First Boot Status
Comment=Monitor Wattsworth initialization steps
Exec=first_boot_gui_notify
Categories=Utility;
......@@ -59,6 +59,20 @@ class common {
enable => true,
require => File['/etc/systemd/system/first_boot.service']
}
file { '/etc/profile.d/first_boot.sh':
ensure => present,
owner => root,
group => root,
mode => '0755',
source => 'puppet:///modules/common/first_boot_sh_notify.sh'
}
file { '/usr/local/bin/first_boot_status':
ensure => present,
owner => root,
group => root,
mode => '0755',
source => 'puppet:///modules/common/first_boot_status.sh'
}
if $facts['platform'] == 'rpi' {
file {'/etc/xdg/lxsession/LXDE-pi/autostart':
ensure => present,
......@@ -67,6 +81,23 @@ class common {
mode => '0755',
source => 'puppet:///modules/common/autostart_xdg'
}
} else {
file {'/etc/skel/.config':
ensure => directory,
owner => root,
group => root,
mode => '0644',
}
file {'/etc/skel/.config/first_boot.desktop':
ensure => present,
owner => root,
group => root,
mode => '0644',
source => 'puppet:///modules/common/ubuntu_autostart',
require => File["/etc/skel/.config"]
}
}
......
......@@ -37,6 +37,7 @@ class joule {
user{'joule':
ensure => present,
uid => 901,
groups => 'dialout',
system => true
}
......
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