Install pi-fan-controller
This commit is contained in:
parent
d8cdcf3d7f
commit
a5ccee9f10
|
@ -1,12 +1,36 @@
|
||||||
# vim: ft=yaml.ansible
|
# 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
|
- name: Install apt-update-push
|
||||||
shell:
|
command: "/home/{{ ansible_user }}/apt-update-push/install.sh"
|
||||||
cmd: "echo 'topic={{ secrets.ntfy_topic }}' > .env && ./install.sh"
|
listen: apt-update-push
|
||||||
stdin: 20
|
|
||||||
chdir: "/home/{{ ansible_user }}/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
|
- name: Restart sshd
|
||||||
service:
|
service:
|
||||||
name: sshd
|
name: sshd
|
||||||
state: restarted
|
state: restarted
|
||||||
|
listen: sshd
|
||||||
|
|
|
@ -37,4 +37,15 @@
|
||||||
single_branch: true
|
single_branch: true
|
||||||
depth: 1
|
depth: 1
|
||||||
become: false
|
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
|
||||||
|
|
|
@ -11,18 +11,18 @@
|
||||||
regexp: '^#?PubkeyAuthentication '
|
regexp: '^#?PubkeyAuthentication '
|
||||||
line: PubkeyAuthentication yes
|
line: PubkeyAuthentication yes
|
||||||
dest: /etc/ssh/sshd_config
|
dest: /etc/ssh/sshd_config
|
||||||
notify: Restart sshd
|
notify: sshd
|
||||||
|
|
||||||
- name: Disallow SSH login with password
|
- name: Disallow SSH login with password
|
||||||
lineinfile:
|
lineinfile:
|
||||||
regexp: '^#?PasswordAuthentication '
|
regexp: '^#?PasswordAuthentication '
|
||||||
line: PasswordAuthentication no
|
line: PasswordAuthentication no
|
||||||
dest: /etc/ssh/sshd_config
|
dest: /etc/ssh/sshd_config
|
||||||
notify: Restart sshd
|
notify: sshd
|
||||||
|
|
||||||
- name: Disallow root login over SSH
|
- name: Disallow root login over SSH
|
||||||
lineinfile:
|
lineinfile:
|
||||||
regexp: '^#?PermitRootLogin '
|
regexp: '^#?PermitRootLogin '
|
||||||
line: PermitRootLogin no
|
line: PermitRootLogin no
|
||||||
dest: /etc/ssh/sshd_config
|
dest: /etc/ssh/sshd_config
|
||||||
notify: Restart sshd
|
notify: sshd
|
||||||
|
|
2
roles/os_config/templates/env.j2
Normal file
2
roles/os_config/templates/env.j2
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
topic={{ secrets.ntfy_topic }}
|
||||||
|
hour=20
|
Reference in a new issue