Install pi-fan-controller

This commit is contained in:
Sam A. 2022-12-31 15:53:24 +01:00
parent d8cdcf3d7f
commit a5ccee9f10
Signed by: samsapti
GPG key ID: CBBBE7371E81C4EA
4 changed files with 45 additions and 8 deletions

View file

@ -1,12 +1,36 @@
# vim: ft=yaml.ansible
---
- name: Create .env for apt-update-push
template:
src: env.j2
dest: "/home/{{ ansible_user }}/apt-update-push/.env"
owner: root
mode: u=rw,go=
listen: apt-update-push
- name: Install apt-update-push
shell:
cmd: "echo 'topic={{ secrets.ntfy_topic }}' > .env && ./install.sh"
stdin: 20
chdir: "/home/{{ ansible_user }}/apt-update-push"
command: "/home/{{ ansible_user }}/apt-update-push/install.sh"
listen: apt-update-push
- name: Change GPIO_PIN
lineinfile:
regexp: '^GPIO_PIN = '
line: GPIO_PIN = 14
dest: "/home/{{ ansible_user }}/pi-fan-controller/fancontrol.py"
listen: pi-fan-controller
- name: Install requirements for pi-fan-controller
pip:
requirements: "/home/{{ ansible_user }}/pi-fan-controller/requirements.txt"
executable: pip3
listen: pi-fan-controller
- name: Install pi-fan-controller
command: "/home/{{ ansible_user }}/pi-fan-controller/script/install"
listen: pi-fan-controller
- name: Restart sshd
service:
name: sshd
state: restarted
listen: sshd

View file

@ -37,4 +37,15 @@
single_branch: true
depth: 1
become: false
notify: Install apt-update-push
notify: apt-update-push
- name: Clone pi-fan-controller
git:
dest: "/home/{{ ansible_user }}/pi-fan-controller"
repo: https://github.com/Howchoo/pi-fan-controller.git
clone: true
update: false
single_branch: true
depth: 1
become: false
notify: pi-fan-controller

View file

@ -11,18 +11,18 @@
regexp: '^#?PubkeyAuthentication '
line: PubkeyAuthentication yes
dest: /etc/ssh/sshd_config
notify: Restart sshd
notify: sshd
- name: Disallow SSH login with password
lineinfile:
regexp: '^#?PasswordAuthentication '
line: PasswordAuthentication no
dest: /etc/ssh/sshd_config
notify: Restart sshd
notify: sshd
- name: Disallow root login over SSH
lineinfile:
regexp: '^#?PermitRootLogin '
line: PermitRootLogin no
dest: /etc/ssh/sshd_config
notify: Restart sshd
notify: sshd

View file

@ -0,0 +1,2 @@
topic={{ secrets.ntfy_topic }}
hour=20