diff --git a/ansible.cfg b/ansible.cfg index 81f79cb..34b901e 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -4,7 +4,8 @@ interpreter_python = auto_silent nocows = 1 timeout= 60 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_args = -o StrictHostKeyChecking=no diff --git a/bin/measure_temp.sh b/bin/measure_temp.sh new file mode 100755 index 0000000..9aa97d0 --- /dev/null +++ b/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 + diff --git a/bin/run-stressberry.sh b/bin/run-stressberry.sh index e1b300f..e2deadc 100644 --- a/bin/run-stressberry.sh +++ b/bin/run-stressberry.sh @@ -3,6 +3,6 @@ mkdir -p /tank/stressberry/${HOSTNAME} cd /tank/stressberry/${HOSTNAME} -/usr/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-run -n "${HOSTNAME}" -d 1800 -i 300 -c 4 ${HOSTNAME}.out +~/.local/bin/stressberry-plot ${HOSTNAME}.out -f -d 300 -f -l 400 3100 -t 25 90 -o ${HOSTNAME}.png --not-transparent diff --git a/hosts b/hosts index 30063d3..4ae3c10 100644 --- a/hosts +++ b/hosts @@ -7,6 +7,12 @@ pi-tanked: hans: cleatus: clancy: + database: + +zero2w: + hosts: + steve: + ziff: bramble4: hosts: @@ -14,6 +20,23 @@ bramble4: willie: kirk: 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: hosts: @@ -30,9 +53,10 @@ pi4: kirk: brandine: martin: - lenny: terry: skinner: + database: + raspberrypi: pis: hosts: @@ -47,13 +71,13 @@ pis: mary: sherry: carl: + database: barney: kirk: brandine: edna: arnie: bart: - lenny: apu: vars: ansible_python_interpreter: /usr/bin/python3 @@ -63,6 +87,7 @@ pis: 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 blini: hosts: quimby: @@ -95,17 +120,11 @@ frinks: ansible_ssh_private_key_file: ~/.ssh/id_rsa servers: hosts: -# ollital.nrw: -# vasmani.de: -# ollital.net: ashkente.de: -# 85.214.129.239: mail.olli-cloud.de: git.olli-cloud.de: - mumble.olli-cloud.de: blog.olli-cloud.de: mehrnext.de: -# h2951071.stratoserver.net: vars: ansible_python_interpreter: /usr/bin/python3 ansible_connection: ssh diff --git a/initpi.yml b/initpi.yml index 7d08a33..6b999ea 100644 --- a/initpi.yml +++ b/initpi.yml @@ -5,7 +5,7 @@ roles: - initpi - installpkg - - mountbackup + - mounttank - installsoft - log2ram - disableswap diff --git a/roles/installpkg/tasks/main.yml b/roles/installpkg/tasks/main.yml index 29422a0..9009c4f 100644 --- a/roles/installpkg/tasks/main.yml +++ b/roles/installpkg/tasks/main.yml @@ -8,6 +8,7 @@ apt: name: - neofetch +# - nala - cowsay - docker.io - git @@ -19,7 +20,7 @@ - lsof - ripgrep - atop - - btop +# - btop - htop - pip - sysbench diff --git a/roles/log2ram/tasks/main.yml b/roles/log2ram/tasks/main.yml index 3e434dd..a32528e 100644 --- a/roles/log2ram/tasks/main.yml +++ b/roles/log2ram/tasks/main.yml @@ -11,7 +11,7 @@ - name: Paketquelle become: true apt_repository: - repo: 'deb http://packages.azlux.fr/debian/ buster main' + repo: 'deb http://packages.azlux.fr/debian/ bookworm main' state: present filename: log2ram update_cache: yes diff --git a/roles/mounttank/tasks/main.yml b/roles/mounttank/tasks/main.yml index 39f36ab..f8887e7 100644 --- a/roles/mounttank/tasks/main.yml +++ b/roles/mounttank/tasks/main.yml @@ -2,5 +2,7 @@ become: true ansible.posix.mount: - path: /tank - state: mounted + path: /tank + state: mounted + fstype: nfs + src: 192.168.178.36:/mnt/md0/public diff --git a/roles/stresspi/tasks/main.yml b/roles/stresspi/tasks/main.yml index 47b69b6..a77bbcd 100644 --- a/roles/stresspi/tasks/main.yml +++ b/roles/stresspi/tasks/main.yml @@ -1,26 +1,27 @@ -- name: PI Update - become: true - apt: - update_cache: yes - upgrade: dist -- name: Stress installieren (apt) +- name: create venv dir + file: + path: ~/venv + state: directory + +- name: virtualenv installieren become: true apt: name: - - stress - - libjpeg-dev - - zlib1g-dev - - libatlas-base-dev - - cmake - - python3-numpy + - python3-virtualenv +- 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: name: - stressberry -# - numpy + - numpy extra_args: --break-system-packages - name: copy script @@ -37,5 +38,3 @@ become_user: pi command: ~/bin/run-stressberry.sh - - diff --git a/roles/subtasks/reboot.yml b/roles/subtasks/reboot.yml new file mode 100644 index 0000000..8a323e1 --- /dev/null +++ b/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 + diff --git a/roles/subtasks/upgrade.yml b/roles/subtasks/upgrade.yml new file mode 100644 index 0000000..ac86fa2 --- /dev/null +++ b/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 + diff --git a/roles/updatepi/tasks/main.yml b/roles/updatepi/tasks/main.yml index 610aa51..61c0af4 100644 --- a/roles/updatepi/tasks/main.yml +++ b/roles/updatepi/tasks/main.yml @@ -11,16 +11,5 @@ regexp: buster replace: bookworm when: stat_result.stat.exists - -- name: PIs aktualisieren - 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 - +- include_tasks: ../subtasks/upgrade.yml +- include_tasks: ../subtasks/reboot.yml diff --git a/roles/updateservers/tasks/main.yml b/roles/updateservers/tasks/main.yml index d521659..c0d9ab6 100644 --- a/roles/updateservers/tasks/main.yml +++ b/roles/updateservers/tasks/main.yml @@ -1,13 +1,2 @@ -- name: Servers aktualisieren - become: true - 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 - - +- include: ../subtasks/upgrade.yml +- include: ../subtasks/reboot.yml diff --git a/updatepis.yml b/updatepis.yml index 0ed5f16..0114313 100644 --- a/updatepis.yml +++ b/updatepis.yml @@ -4,4 +4,5 @@ remote_user: pi roles: - updatepi +# - update-sshkey diff --git a/updateservers.yml b/updateservers.yml index f6f0448..cfd4cee 100644 --- a/updateservers.yml +++ b/updateservers.yml @@ -4,4 +4,5 @@ remote_user: olli roles: - updateservers +# - update-sshkey