Skip to content

Commit

Permalink
reduced old setups. Vagrant and ansible preparation scripts added
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuehn committed May 8, 2019
1 parent c7417da commit 8ad79cd
Show file tree
Hide file tree
Showing 4 changed files with 143 additions and 3 deletions.
25 changes: 25 additions & 0 deletions shell/setup/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"

config.vm.box_check_update = false

config.ssh.forward_agent = true
config.ssh.insert_key = false

config.vm.hostname = "vactioncam"
config.vm.network "public_network", ip: "192.168.178.33"

config.vm.provider "virtualbox" do |vb|
vb.name = "vactioncam"
vb.memory = "4096"
vb.cpus = 2
vb.customize ["modifyvm", :id, "--groups", "/vagrants"]
end

config.vm.provision "ansible" do |ansible|
ansible.playbook = "./actioncam-prepare.yml"
end

end
117 changes: 117 additions & 0 deletions shell/setup/actioncam-prepare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
---
# complete installation with some to ease tryout's
- hosts: all
vars:
- ansible_python_interpreter: "/usr/bin/env python3"
- actioncam_dir_git: "{{ ansible_env.HOME }}/git/actioncam"
- actioncam_dir_home: "{{ ansible_env.HOME }}/actioncam"
- proxy_use: false
- proxy_web: 'http://192.168.178.10:8888'

tasks:
- name: say hello
debug:
msg: "Hello {{ ansible_hostname }}"

- name: use proxy for apt
become: true
lineinfile:
path: '/etc/apt/apt.conf.d/00proxy'
line: 'Acquire::http::Proxy "{{ proxy_web }}";'
create: yes
when: proxy_use == true

- name: delete proxy file
become: true
file:
state: absent
path: '/etc/apt/apt.conf.d/00proxy'
when: proxy_use != true

- name: Update APT package manager repositories cache
become: true
apt:
update_cache: yes

- name: Upgrade installed packages
become: true
apt:
upgrade: dist

- name: APT - install misc packages
become: true
apt:
name: ['ca-certificates', 'git', 'mc', 'uuid','ansible']
update_cache: yes

- name: APT - install python3 dev packages
become: true
apt:
name: ['python3-dev', 'python3-venv', 'python3-gflags', 'python3-pip']

- name: upgrade pip
become: true
shell: pip3 install --upgrade pip

- name: Git clone actioncam
git:
repo: https://github.com/hackffm/actioncam
dest: "{{ actioncam_dir_git }}"
version: master
depth: 1
force: yes

- name: APT install opencv requiered libs 1 - 6
become: true
apt:
name: ['libatlas3-base', 'libwebp6', 'libtiff5', 'libilmbase12', 'libopenexr22']

- name: APT install opencv requiered libs 2 - 6
become: true
apt:
name: ['libilmbase12', 'libgstreamer1.0-0', 'libavcodec57', 'libavformat57', 'libavutil55']

- name: APT install opencv requiered libs 3 - 6
become: true
apt:
name: ['libswscale4', 'libgtk-3-0', 'libpangocairo-1.0-0', 'libpango-1.0-0', 'libatk1.0-0']

- name: APT install opencv requiered libs 4 - 6
become: true
apt:
name: ['libcairo-gobject2', 'libcairo2', 'libgdk-pixbuf2.0-0']

- name: APT install opencv requiered libs 5 - 6
become: true
apt:
name: ['libsz2', 'libharfbuzz0b', 'libtiff5']

- name: APT install opencv requiered libs 6 - 6
become: true
apt:
name: ['libgstreamer1.0-0', 'libavcodec57', 'libqtgui4', 'libqt4-test', 'libqtcore4']

- name: pip3 install requierements
become: true
shell: "pip3 install -r {{ actioncam_dir_git }}/shell/setup/requirements_su.txt"

- name: actioncam create log folder
file:
path: "{{ actioncam_dir_home }}/log"
state: directory
mode: 0755

- name: actioncam create recording folder
file:
path: "{{ actioncam_dir_home }}/recording"
state: directory
mode: 0755

- name: copy config.json to actioncam workfolder
copy: src="{{ actioncam_dir_git }}/shell/setup/config.json" dest="{{ actioncam_dir_home }}/config.json" remote_src=yes

- name: set true homefolder in config.json
replace:
path: "{{ actioncam_dir_home }}/config.json"
regexp: "/home/pi/actioncam"
replace: "{{ actioncam_dir_home }}"
2 changes: 0 additions & 2 deletions shell/setup/actioncam_installation_lx86.sh

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# does not currently work !
# not complete right now
./setup_debs.sh
./setup_folders.sh

0 comments on commit 8ad79cd

Please sign in to comment.