Files
deploy_home/ansible/roles/motion/tasks/motion.yml

56 lines
1.4 KiB
YAML

---
- name: create shinobi user
become: true
ansible.builtin.user:
name: "{{ motion_user }}"
shell: /bin/nologin
tags: motion
- name: mount shinob videos folder
become: true
ansible.builtin.file:
path: /mnt/shinobi
state: directory
owner: "{{ motion_user }}"
group: "{{ motion_user }}"
mode: 0755
tags: motion
- name: mount smb via cifs
become: true
ansible.posix.mount:
path: /mnt/shinobi
src: "//{{ motion_hostname }}/share/GardenCamera"
fstype: cifs
# yamllint disable-line rule:line-length
opts: "username={{ motion_user }},password={{ motion_pass }},workgroup=workgroup,iocharset=utf8,uid={{ motion_user }},gid={{ motion_user }}"
state: mounted
tags: motion
- name: create shinobi data volume
become: true
community.general.docker_volume:
name: shinobi_data
tags: motion
- name: create shinobi server container
diff: false
community.general.docker_container:
name: shinobi
image: migoller/shinobidocker:latest
recreate: false
restart: true
restart_policy: on-failure
restart_retries: 3
log_driver: syslog
log_options:
syslog-address: "udp://localhost:{{ syslog_udp_default }}"
syslog-facility: daemon
tag: "docker/{{'{{'}} .Name {{'}}'}}"
volumes:
- "shinobi_data:/var/lib/mysql"
- "/mnt/shinobi:/opt/shinobi/videos"
ports:
- "8085:8080"
tags: motion