CU-1newj99 Added motion camera deployment to home server
This commit is contained in:
7
ansible/roles/motion/tasks/deps.yml
Normal file
7
ansible/roles/motion/tasks/deps.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
- name: install motion
|
||||
become: true
|
||||
pacman:
|
||||
name: "{{ deps }}"
|
||||
state: present
|
||||
tags: deps
|
||||
3
ansible/roles/motion/tasks/main.yml
Normal file
3
ansible/roles/motion/tasks/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
- import_tasks: deps.yml
|
||||
- import_tasks: motion.yml
|
||||
26
ansible/roles/motion/tasks/motion.yml
Normal file
26
ansible/roles/motion/tasks/motion.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
- name: create motion directory
|
||||
become: true
|
||||
file:
|
||||
path: "{{ motion_target_dir }}"
|
||||
state: directory
|
||||
owner: "{{ nfs_user }}"
|
||||
group: "{{ nfs_group }}"
|
||||
mode: 0755
|
||||
|
||||
- name: template motion config
|
||||
become: true
|
||||
template:
|
||||
src: templates/motion.conf.j2
|
||||
dest: /etc/motion/motion.conf
|
||||
mode: 0644
|
||||
backup: true
|
||||
notify:
|
||||
- restart_motion
|
||||
|
||||
- name: enable (now) motion.service
|
||||
become: true
|
||||
service:
|
||||
name: motion.service
|
||||
state: started
|
||||
enabled: true
|
||||
Reference in New Issue
Block a user