Browse Source

updatepis mit subtasks.

master
Olli Graf 1 year ago
parent
commit
eb2c0d086d
  1. 3
      ansible.cfg
  2. 9
      bin/measure_temp.sh
  3. 4
      bin/run-stressberry.sh
  4. 35
      hosts
  5. 2
      initpi.yml
  6. 3
      roles/installpkg/tasks/main.yml
  7. 2
      roles/log2ram/tasks/main.yml
  8. 6
      roles/mounttank/tasks/main.yml
  9. 31
      roles/stresspi/tasks/main.yml
  10. 6
      roles/subtasks/reboot.yml
  11. 9
      roles/subtasks/upgrade.yml
  12. 15
      roles/updatepi/tasks/main.yml
  13. 15
      roles/updateservers/tasks/main.yml
  14. 1
      updatepis.yml
  15. 1
      updateservers.yml

3
ansible.cfg

@ -4,7 +4,8 @@ interpreter_python = auto_silent
nocows = 1 nocows = 1
timeout= 60 timeout= 60
force_valid_group_names = ignore force_valid_group_names = ignore
private_key_file = ~/.ssh/id_rsa private_key_file = ~/.ssh/id_ed25519
#private_key_file = ~/.ssh/id_rsa
[ssh_connection] [ssh_connection]
ssh_args = -o StrictHostKeyChecking=no ssh_args = -o StrictHostKeyChecking=no

9
bin/measure_temp.sh

@ -0,0 +1,9 @@
#! /bin/bash
for f in {1..10}
do
vcgencmd measure_temp
sysbench cpu --cpu-max-prime=50000 --threads=4 --time=120 run > /dev/null 2>&1
done
vcgencmd measure_temp

4
bin/run-stressberry.sh

@ -3,6 +3,6 @@
mkdir -p /tank/stressberry/${HOSTNAME} mkdir -p /tank/stressberry/${HOSTNAME}
cd /tank/stressberry/${HOSTNAME} cd /tank/stressberry/${HOSTNAME}
/usr/local/bin/stressberry-run -n "${HOSTNAME}" -d 1800 -i 300 -c 4 ${HOSTNAME}.out ~/.local/bin/stressberry-run -n "${HOSTNAME}" -d 1800 -i 300 -c 4 ${HOSTNAME}.out
/usr/local/bin/stressberry-plot ${HOSTNAME}.out -f -d 300 -f -l 400 2200 -t 25 90 -o ${HOSTNAME}.png --not-transparent ~/.local/bin/stressberry-plot ${HOSTNAME}.out -f -d 300 -f -l 400 3100 -t 25 90 -o ${HOSTNAME}.png --not-transparent

35
hosts

@ -7,6 +7,12 @@ pi-tanked:
hans: hans:
cleatus: cleatus:
clancy: clancy:
database:
zero2w:
hosts:
steve:
ziff:
bramble4: bramble4:
hosts: hosts:
@ -14,6 +20,23 @@ bramble4:
willie: willie:
kirk: kirk:
brandine: brandine:
vars:
ansible_python_interpreter: /usr/bin/python3
ansible_connection: ssh
ansible_sudo: true
ansible_become: true
ansible_user: pi
ansible_ssh_common_args: '-o StrictHostKeyChecking=no'
ansible_ssh_private_key_file: ~/.ssh/id_rsa
# ansible_ssh_private_key_file: ~/.ssh/id_ed25519
rock5b:
hosts:
stu:
pi5:
hosts:
uter:
kodos:
pi4: pi4:
hosts: hosts:
@ -30,9 +53,10 @@ pi4:
kirk: kirk:
brandine: brandine:
martin: martin:
lenny:
terry: terry:
skinner: skinner:
database:
raspberrypi:
pis: pis:
hosts: hosts:
@ -47,13 +71,13 @@ pis:
mary: mary:
sherry: sherry:
carl: carl:
database:
barney: barney:
kirk: kirk:
brandine: brandine:
edna: edna:
arnie: arnie:
bart: bart:
lenny:
apu: apu:
vars: vars:
ansible_python_interpreter: /usr/bin/python3 ansible_python_interpreter: /usr/bin/python3
@ -63,6 +87,7 @@ pis:
ansible_user: pi ansible_user: pi
ansible_ssh_common_args: '-o StrictHostKeyChecking=no' ansible_ssh_common_args: '-o StrictHostKeyChecking=no'
ansible_ssh_private_key_file: ~/.ssh/id_rsa ansible_ssh_private_key_file: ~/.ssh/id_rsa
# ansible_ssh_private_key_file: ~/.ssh/id_ed25519
blini: blini:
hosts: hosts:
quimby: quimby:
@ -95,17 +120,11 @@ frinks:
ansible_ssh_private_key_file: ~/.ssh/id_rsa ansible_ssh_private_key_file: ~/.ssh/id_rsa
servers: servers:
hosts: hosts:
# ollital.nrw:
# vasmani.de:
# ollital.net:
ashkente.de: ashkente.de:
# 85.214.129.239:
mail.olli-cloud.de: mail.olli-cloud.de:
git.olli-cloud.de: git.olli-cloud.de:
mumble.olli-cloud.de:
blog.olli-cloud.de: blog.olli-cloud.de:
mehrnext.de: mehrnext.de:
# h2951071.stratoserver.net:
vars: vars:
ansible_python_interpreter: /usr/bin/python3 ansible_python_interpreter: /usr/bin/python3
ansible_connection: ssh ansible_connection: ssh

2
initpi.yml

@ -5,7 +5,7 @@
roles: roles:
- initpi - initpi
- installpkg - installpkg
- mountbackup - mounttank
- installsoft - installsoft
- log2ram - log2ram
- disableswap - disableswap

3
roles/installpkg/tasks/main.yml

@ -8,6 +8,7 @@
apt: apt:
name: name:
- neofetch - neofetch
# - nala
- cowsay - cowsay
- docker.io - docker.io
- git - git
@ -19,7 +20,7 @@
- lsof - lsof
- ripgrep - ripgrep
- atop - atop
- btop # - btop
- htop - htop
- pip - pip
- sysbench - sysbench

2
roles/log2ram/tasks/main.yml

@ -11,7 +11,7 @@
- name: Paketquelle - name: Paketquelle
become: true become: true
apt_repository: apt_repository:
repo: 'deb http://packages.azlux.fr/debian/ buster main' repo: 'deb http://packages.azlux.fr/debian/ bookworm main'
state: present state: present
filename: log2ram filename: log2ram
update_cache: yes update_cache: yes

6
roles/mounttank/tasks/main.yml

@ -2,5 +2,7 @@
become: true become: true
ansible.posix.mount: ansible.posix.mount:
path: /tank path: /tank
state: mounted state: mounted
fstype: nfs
src: 192.168.178.36:/mnt/md0/public

31
roles/stresspi/tasks/main.yml

@ -1,26 +1,27 @@
- name: PI Update - name: create venv dir
become: true file:
apt: path: ~/venv
update_cache: yes state: directory
upgrade: dist
- name: Stress installieren (apt) - name: virtualenv installieren
become: true become: true
apt: apt:
name: name:
- stress - python3-virtualenv
- libjpeg-dev
- zlib1g-dev
- libatlas-base-dev
- cmake
- python3-numpy
- name: virtuelle Umgebung anlegen
command:
cmd: virtualenv ~/venv/stressberry
creates: "~/venv/stressberry"
#- name: aktiviere virtuelle Umgebung
# shell: source ~/venv/stressberry/bin/activate
- name : Stress installieren(pip) - name: Stressberry installieren
ansible.builtin.pip: ansible.builtin.pip:
name: name:
- stressberry - stressberry
# - numpy - numpy
extra_args: --break-system-packages extra_args: --break-system-packages
- name: copy script - name: copy script
@ -37,5 +38,3 @@
become_user: pi become_user: pi
command: ~/bin/run-stressberry.sh command: ~/bin/run-stressberry.sh

6
roles/subtasks/reboot.yml

@ -0,0 +1,6 @@
---
- name: Neustart if /var/run/reboot-reqired exists
command: shutdown -r now
args:
removes: /var/run/reboot-required

9
roles/subtasks/upgrade.yml

@ -0,0 +1,9 @@
---
- name: APT upgrade
become: true
apt:
upgrade: dist
update_cache: yes
cache_valid_time: 86400
autoremove: yes

15
roles/updatepi/tasks/main.yml

@ -11,16 +11,5 @@
regexp: buster regexp: buster
replace: bookworm replace: bookworm
when: stat_result.stat.exists when: stat_result.stat.exists
- include_tasks: ../subtasks/upgrade.yml
- name: PIs aktualisieren - include_tasks: ../subtasks/reboot.yml
become: true
apt:
upgrade: dist
update_cache: yes
cache_valid_time: 120
autoremove: yes
- name: Pi Neustart if /var/run/reboot-reqired exists
command: shutdown -r now
args:
removes: /var/run/reboot-required

15
roles/updateservers/tasks/main.yml

@ -1,13 +1,2 @@
- name: Servers aktualisieren - include: ../subtasks/upgrade.yml
become: true - include: ../subtasks/reboot.yml
apt:
upgrade: dist
update_cache: yes
cache_valid_time: 86400
autoremove: yes
- name: Server Neustart if /var/run/reboot-reqired exists
command: shutdown -r now
args:
removes: /var/run/reboot-required

1
updatepis.yml

@ -4,4 +4,5 @@
remote_user: pi remote_user: pi
roles: roles:
- updatepi - updatepi
# - update-sshkey

1
updateservers.yml

@ -4,4 +4,5 @@
remote_user: olli remote_user: olli
roles: roles:
- updateservers - updateservers
# - update-sshkey

Loading…
Cancel
Save