ansible-role-motion/templates/motion.conf.j2

20 lines
557 B
Text
Raw Permalink Normal View History

2022-10-11 09:19:01 +02:00
{% if motion_config %}{% for key, value in motion_config.items() %}
{% if key != 'cameras' and key != "camera" %}{{ key }} {{ value }}{% endif %}
{% endfor %}{% endif %}
{% if motion_config['cameras']|length < 2 %}
# Only camera
{% for key, value in motion_config['cameras'][0].items() %}
{% if value != "" %}
{{ key }} {{ value }}
{% else %}
# {{ key }}
{% endif %}
{% endfor %}
# End of only camera
{% else %}
{% for camera in motion_config['cameras'] %}
camera {{ motion_config['camera_dir'] }}/{{ camera['camera_name'] }}.conf
{% endfor %}
{% endif %}