Giter VIP home page Giter VIP logo

ansible-motion's Introduction

ansible-motion

Installs motion as a systemd-managed docker container.

Requirements

CPU architecture:

  • x86_64 / amd64
  • armv7l / armhf
  • aarch64 / arm64

Operating systems:

  • Ubuntu:
    • 16.04 (xenial)
    • 18.04 (bionic)
    • 20.04 (focal)
  • Debian
    • 9 (stretch)
    • 10 (buster)

Role requirements

  • python-docker package

What this role does

  • Create volume directories
  • Setup motion config
  • Setup motion cam configs
  • Setup Dockerfile and build docker image
  • Setup systemd unit file
  • Restart/start systemd service

Role parameters

Variable Type Mandatory? Default Description
motion_config_volume text yes Where the motion config will be stored
motion_log_volume text yes Where the motion logs will be stored
motion_data_volume text yes Where the motion data (like records) will be stored
motion_cameras array of motion_camera no [] The separate camera configurations

motion_camera definition

Variable Type Mandatory? Default Description
name text yes Configured camera name; Used for the configuration file name
stream_port integer yes The configured cam stream port
target_dir text no The directory to store the records of this cam
options Map of text key/values no [] The motion camera options Read the docs!

Usage

Add to requirements.yml

- name: install-motion
  src: https://github.com/borisskert/ansible-motion.git
  scm: git

example playbook.yml

---
- hosts: all
  become: true

  roles:
    - role: ansible-motion
      motion_config_volume: /srv/motion/config
      motion_log_volume: /srv/motion/log
      motion_data_volume: /srv/motion/data
      motion_cameras:
       - name: usb_cam
         stream_port: 8081
         target_dir: usb_cam
         options:
           videodevice: /dev/video0
           input: -1
           text_left: USB CAM
           width: 1920
           height: 1080
           framerate: 60
           ffmpeg_video_codec: mpeg4
       - name: video_card_cam
         stream_port: 8082
         options:
           videodevice: /dev/video1
           input: 1
           text_left: VIDEO CAM

Testing

Requirements:

Run within docker

molecule test

Run within Vagrant

 molecule test --scenario-name vagrant --parallel

I recommend to use pyenv for local testing. Within the Github Actions pipeline I use my own molecule Docker image.

License

MIT

Author Information

Links

ansible-motion's People

Contributors

borisskert avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.