Herramientas de usuario

Herramientas del sitio


proyectos:linuxservidor-adm-ansible

Instalar ansible en el servidor

apt install ansible
ansible --version

Crear la llave ssh y copiarla en los clientes

su -
ssh-keygen
ssh-copy-id root@IP-CADA-CLIENTE

Crear archivo hosts

echo "[MotionEye]" >> hosts
echo "root@IP-CADA-CLIENTE" >> hosts

Probar conexión con los clientes

ansible -i hosts -m ping motioneye

Ejecutar un playbook

ansible-playbook  -v -i hosts   motioneye/install.yaml  

Ejemplo de instalación de motioneye

Aca esta el instructivo que se tradujo https://github.com/ccrisan/motioneye/wiki/Install-On-Raspbian

---
- hosts: MotionEye
  remote_user: root
  tasks:
    - name: Install latest versions of  motion dependencies libraries ffmpeg,libmariadb3,libpq5,libmicrohttpd12
      apt: name=ffmpeg,libmariadb3,libpq5,libmicrohttpd12 state=latest
    - name: Download motioneye deb
      get_url:  url=https://github.com/Motion-Project/motion/releases/download/release-4.2.2/pi_buster_motion_4.2.2-1_armhf.deb dest=/tmp/
    - name: Install a pi_buster_motion_4.2.2-1_armhf.deb package
      apt: deb=/tmp/pi_buster_motion_4.2.2-1_armhf.deb
    - name:  Install lates versions of motioen eye dependencies python-pip,python-dev,libssl-dev,libcurl4-openssl-dev,libjpeg-dev,libz-dev
      apt: name=python-pip,python-dev,libssl-dev,libcurl4-openssl-dev,libjpeg-dev,libz-dev state=latest
    - name: Install motioneye via pip
      pip: name=motioneye
    - name: Creating /etc/motioneye directory
      file: path=/etc/motioneye  state=directory  owner={{ ansible_ssh_user }}   group={{ ansible_ssh_user }}
    - name: Create the  motioneye.conf 
      copy:
        src=/usr/local/share/motioneye/extra/motioneye.conf.sample
        dest=/etc/motioneye/motioneye.conf
        remote_src=yes
        owner={{ ansible_ssh_user }}
        group={{ ansible_ssh_user }}
    - name: Creating /var/lib/motioneye directory
      file: path=/var/lib/motioneye  state=directory  owner={{ ansible_ssh_user }}   group={{ ansible_ssh_user }}
    - name: Install  systemd init script
      copy: 
        src=/usr/local/share/motioneye/extra/motioneye.systemd-unit-local 
        dest=/etc/systemd/system/motioneye.service 
        remote_src=yes
        owner={{ ansible_ssh_user }}
        group={{ ansible_ssh_user }}
    - name: Restart the motioneye systemd service
      systemd:
        enabled=yes
        state=started
        daemon_reload=yes
        name=motioneye

Referencias

proyectos/linuxservidor-adm-ansible.txt · Última modificación: por manuel.floresv