diff --git a/IobPi.sls b/IobPi.sls new file mode 100644 index 0000000..33952da --- /dev/null +++ b/IobPi.sls @@ -0,0 +1,9 @@ +# Gestione pacchetti base x raspberry +log2ram-installer: + cmd.script: + - name: /root/log2ramInstall.sh + - source: salt://log2ramInstall.sh + + +# aggiunta pacchetti IOB-PI per MAPO + diff --git a/IobPiArchiveOld.sh b/IobPiArchiveOld.sh new file mode 100644 index 0000000..12b2e5d --- /dev/null +++ b/IobPiArchiveOld.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# Archiviazione eventuali cartelle MAPO precedenti... + +# creo archivio +mkdir -p /home/pi/bck/ +tar cfz /home/pi/bck/steamware-`date +%F`.tgz /home/pi/steamware + +# cancello old +rm -rdf /home/pi/steamware diff --git a/base.sls b/base.sls index 65b63fb..50e5596 100644 --- a/base.sls +++ b/base.sls @@ -19,6 +19,11 @@ mc: links2: pkg: - installed + etckeeper: pkg: - installed + +locate: + pkg: + - installed diff --git a/checkTemp.sh b/checkTemp.sh new file mode 100755 index 0000000..a6cf8d8 --- /dev/null +++ b/checkTemp.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Purpose: Display the ARM CPU and GPU temperature of Raspberry Pi 2/3 +# ------------------------------------------------------- +cpu=$( $(/opt/vc/bin/vcgencmd measure_temp) | CPU => $((cpu/1000))'C" >> /var/log/temperature.log diff --git a/checkTempSetup.sh b/checkTempSetup.sh new file mode 100755 index 0000000..5e24477 --- /dev/null +++ b/checkTempSetup.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# Purpose: fix permission + crontab setup +# ------------------------------------------------------- + +# fix permission +chmod +x /usr/local/bin/checkTemp.sh + +# fix crontab... #write out current crontab +crontab -l > mycron +#echo new cron into cron file +echo "0/30 * * * * /usr/local/bin/checkTemp.sh" >> mycron +#install new cron file +crontab mycron +rm mycron diff --git a/iob-pi-setup.sls b/iob-pi-setup.sls new file mode 100644 index 0000000..36fb6a3 --- /dev/null +++ b/iob-pi-setup.sls @@ -0,0 +1,29 @@ +# eseguo install del SW! +iob-pi-dos2unix: + cmd.run: + - name: dos2unix /home/pi/steamware/* + +iob-pi-pre: + cmd.run: + - name: chmod +x /home/pi/steamware/install-RPI-IOB.sh >> /var/log/MapoInstall.log + +iob-pi-setup: + cmd.run: + - name: /home/pi/steamware/install-RPI-IOB.sh >> /var/log/MapoInstall.log + +iob-pi-setup-01: + cmd.run: + - name: chmod +x /etc/init.d/*IOB + +iob-pi-setup-02: + cmd.run: + - name: systemctl enable sendRebootIOB + +iob-pi-setup-03: + cmd.run: + - name: systemctl enable MapoIOB + +iob-pi-setup-04: + cmd.run: + - name: systemctl daemon-reload + diff --git a/iob-pi.sls b/iob-pi.sls new file mode 100644 index 0000000..1035450 --- /dev/null +++ b/iob-pi.sls @@ -0,0 +1,26 @@ +# aggiunta pacchetti IOB-PI per MAPO +iob-pi-download: + file.managed: + - name: /home/pi/src/Mapo.zip + - source: http://nexus.steamware.net/repository/utility/MAPO/IOB-PI/Mapo.zip + - makedirs: True + - source_hash: http://nexus.steamware.net/repository/utility/MAPO/IOB-PI/Mapo.zip.md5 + +# se ci fosse vecchia install --> zip & compact... +archive-old: + cmd.script: + - name: /root/IobPiArchiveOld.sh + - source: salt://IobPiArchiveOld.sh + + +# Ora estraggo files in directory... +extract-IOB-MAN: + archive.extracted: + - name: /home/pi/steamware/ + - source: /home/pi/src/Mapo.zip + - source_hash: http://nexus.steamware.net/repository/utility/MAPO/IOB-PI/Mapo.zip.md5 + - enforce_toplevel: False + - overwrite: True + +# aggiungo sw specifico (python) + diff --git a/log2ramInstall.sh b/log2ramInstall.sh new file mode 100755 index 0000000..6f5a6d4 --- /dev/null +++ b/log2ramInstall.sh @@ -0,0 +1,6 @@ +# esegue install log2ram includendo repo apt + installazione + +echo "deb http://packages.azlux.fr/debian/ buster main" | sudo tee /etc/apt/sources.list.d/azlux.list +wget -qO - https://azlux.fr/repo.gpg.key | sudo apt-key add - +apt update +apt install log2ram diff --git a/raspberry.sls b/raspberry.sls new file mode 100644 index 0000000..87d6bf2 --- /dev/null +++ b/raspberry.sls @@ -0,0 +1,18 @@ +# Gestione pacchetti base x raspberry +log2ram-installer: + cmd.script: + - name: /root/log2ramInstall.sh + - source: salt://log2ramInstall.sh + +# conf log temperatura +templog-download: + file.managed: + - name: /usr/local/bin/checkTemp.sh + - source: salt://checkTemp.sh + - makedirs: true + +templog-setup: + cmd.script: + - source: salt://checkTempSetup.sh + + diff --git a/top.sls b/top.sls index 2bab71f..2458e94 100644 --- a/top.sls +++ b/top.sls @@ -13,6 +13,15 @@ base: - editors - users + 'os:Raspbian': + - match: grain + - sanitize + - raspberry + - base + - utils + - editors + - users + 'roles:developer': - match: grain - utilsWin @@ -57,6 +66,11 @@ base: - match: grain - baseHV + 'roles:iob-pi': + - match: grain + - iob-pi + - iob-pi-setup + # 'roles:ubuVpnSrv': # - match: grain # - ubuVpnSrv diff --git a/utils.sls b/utils.sls index 47eb4af..0f37a34 100644 --- a/utils.sls +++ b/utils.sls @@ -25,3 +25,7 @@ aria2: nnn: pkg: - installed + +dos2unix: + pkg: + - installed