diff --git a/bin/blini.py b/bin/blini.py index 158b246..eb420b8 100755 --- a/bin/blini.py +++ b/bin/blini.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#! /usr/bin/python3 import random import time @@ -14,7 +14,7 @@ to_led=6 def pixel_on(): hostname= get_hostname() - print hostname + print(hostname) for i in range(from_led,to_led): r = 255 b = 255 diff --git a/hosts b/hosts index 030f2ec..ab362e7 100644 --- a/hosts +++ b/hosts @@ -1,7 +1,17 @@ +pi-tanked: + hosts: + quimby: + willie: + kirk: + brandine: + hans: + cleatus: + clancy: + pi4: hosts: clancy: - martin: + willie: quimby: hans: pye: @@ -11,22 +21,26 @@ pi4: sherry: carl: barney: + kirk: + brandine: + martin: pis: hosts: - brandine: - clancy: - martin: - quimby: - kirk: - willie: - hans: - pye: - julius: - carl: - cleatus: - selma: -# barney: + clancy: + willie: + quimby: + hans: + pye: + julius: + cleatus: + mary: + sherry: + carl: + barney: + kirk: + brandine: + edna: vars: ansible_python_interpreter: /usr/bin/python3 ansible_connection: ssh @@ -37,7 +51,7 @@ pis: ansible_ssh_private_key_file: ~/.ssh/id_rsa blini: hosts: - quimby: + 192.168.178.24: willie: kirk: brandine: @@ -71,6 +85,23 @@ servers: vasmani.de: ollital.net: ashkente.de: + olliberry.de: + vars: + ansible_python_interpreter: /usr/bin/python3 + ansible_connection: ssh + ansible_port: 1770 + ansible_sudo: true + ansible_become: true + ansible_user: olli + ansible_ssh_common_args: '-o StrictHostKeyChecking=no' + ansible_ssh_private_key_file: ~/.ssh/id_rsa +serversip: + hosts: + 81.169.195.18: + 85.215.93.229: + 62.75.191.218: + 85.214.240.190: + 85.214.129.239: vars: ansible_python_interpreter: /usr/bin/python3 ansible_connection: ssh @@ -81,3 +112,4 @@ servers: ansible_ssh_common_args: '-o StrictHostKeyChecking=no' ansible_ssh_private_key_file: ~/.ssh/id_rsa + diff --git a/installk3s.yml b/installk3s.yml new file mode 100644 index 0000000..fcf949c --- /dev/null +++ b/installk3s.yml @@ -0,0 +1,7 @@ +--- +- hosts: "{{ target }}" + gather_facts: false + remote_user: pi + roles: + - installk3s + diff --git a/portainer.yml b/portainer.yml new file mode 100644 index 0000000..0b42e6f --- /dev/null +++ b/portainer.yml @@ -0,0 +1,7 @@ +--- +- hosts: "{{ target }}" + gather_facts: false + remote_user: pi + roles: + - installportainer + diff --git a/resources/k3s/cmdline.txt b/resources/k3s/cmdline.txt new file mode 100755 index 0000000..1568bc7 --- /dev/null +++ b/resources/k3s/cmdline.txt @@ -0,0 +1 @@ +console=serial0,115200 console=tty1 root=PARTUUID=18f274fe-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait rfkill.default.state=1 systemd.restore_state=0 cgroup_memory=1 cgroup_enable=memory diff --git a/roles/disableswap/tasks/main.yml b/roles/disableswap/tasks/main.yml index 878314e..7e9c5b8 100644 --- a/roles/disableswap/tasks/main.yml +++ b/roles/disableswap/tasks/main.yml @@ -1,7 +1,8 @@ - name: Disable swap. + become: true shell: > - dphys-swapfile swapoff && - dphys-swapfile uninstall && + /usr/sbin/dphys-swapfile swapoff && + /usr/sbin/dphys-swapfile uninstall && update-rc.d -f dphys-swapfile remove systemctl disable dphys-swapfile # when: diff --git a/roles/initpi/tasks/main.yml b/roles/initpi/tasks/main.yml index 2d7a53a..b90fe07 100644 --- a/roles/initpi/tasks/main.yml +++ b/roles/initpi/tasks/main.yml @@ -31,7 +31,7 @@ - docker.io - git - locate - - yum +# - yum - dnsutils - nfs-kernel-server update_cache: yes diff --git a/roles/installk3s/tasks/main.yml b/roles/installk3s/tasks/main.yml new file mode 100644 index 0000000..fd15906 --- /dev/null +++ b/roles/installk3s/tasks/main.yml @@ -0,0 +1,30 @@ +- name: cmdline.txt + become: true + copy: + src: resources/k3s/{{ item }} + dest: /boot + owner: root + group: root + mode: '0755' + with_items: + - cmdline.txt + +- name: iptables + become: true + shell: > + iptables -F + +- name: create k3s dir + file: + path: ~/k3s-setup + state: directory + +- name: Install k3s + become: true + shell: > + curl -sfL https://get.k3s.io | K3S_KUBECONFIG_MODE=”644” sh - + +- name: Neustart + reboot: + + diff --git a/roles/installportainer/tasks/main.yml b/roles/installportainer/tasks/main.yml new file mode 100644 index 0000000..e1c20f2 --- /dev/null +++ b/roles/installportainer/tasks/main.yml @@ -0,0 +1,16 @@ +- name: Portainer Data Dir + become: true + file: + path: /data + state: directory + +- name: Install Portainer Container + docker_container: + name: portainer + image: portainer/portainer-ce:linux-arm + ports: + - "9000:9000" + restart_policy: always + volumes: + - portainer_data:/data + become: true diff --git a/roles/log2ram/tasks/main.yml b/roles/log2ram/tasks/main.yml index 8c1af0f..3e434dd 100644 --- a/roles/log2ram/tasks/main.yml +++ b/roles/log2ram/tasks/main.yml @@ -1,8 +1,8 @@ -- name: PI Update - become: true - apt: - update_cache: yes - upgrade: dist +#- name: PI Update +# become: true +# apt: +# update_cache: yes +# upgrade: dist - name: Key become: true apt_key: diff --git a/roles/showtemp/tasks/main.yml b/roles/showtemp/tasks/main.yml new file mode 100644 index 0000000..652a3e2 --- /dev/null +++ b/roles/showtemp/tasks/main.yml @@ -0,0 +1,7 @@ +- name: Temperatur Status + shell: > + vcgencmd measure_temp + register: command_output + +- debug: + var: command_output.stdout_lines diff --git a/roles/touchtank/tasks/main.yml b/roles/touchtank/tasks/main.yml new file mode 100644 index 0000000..53c532b --- /dev/null +++ b/roles/touchtank/tasks/main.yml @@ -0,0 +1,5 @@ +- name: Touch Tank + ansible.builtin.file: + path: /tank/pis/{{ inventory_hostname }} + state: touch + mode: u=rw,g=r,o=r diff --git a/roles/updatepi/tasks/main.yml b/roles/updatepi/tasks/main.yml index ed6bfb3..b7f42a7 100644 --- a/roles/updatepi/tasks/main.yml +++ b/roles/updatepi/tasks/main.yml @@ -3,6 +3,6 @@ apt: upgrade: dist update_cache: yes - cache_valid_time: 86400 + cache_valid_time: 120 autoremove: yes diff --git a/temp_status.yml b/temp_status.yml new file mode 100644 index 0000000..77a1ffa --- /dev/null +++ b/temp_status.yml @@ -0,0 +1,7 @@ +--- +- hosts: "{{ target }}" + gather_facts: false + remote_user: pi + roles: + - showtemp + diff --git a/touchtank.yml b/touchtank.yml new file mode 100644 index 0000000..700707f --- /dev/null +++ b/touchtank.yml @@ -0,0 +1,7 @@ +--- +- hosts: "{{ target }}" + gather_facts: false + remote_user: pi + roles: + - touchtank +