Compare commits

...

4 Commits

17 changed files with 24 additions and 250 deletions

View File

@ -1,2 +0,0 @@
rabbitmq_user: satanas
rabbitmq_password: satanas

View File

@ -1,9 +1,5 @@
[car]
satanas.local ansible_user=pi become=yes become_user=root
diabolo.local ansible_user=pi become=yes become_user=root
[microservice]
diabolo.local
[donkey]
satanas.local

View File

@ -93,3 +93,4 @@ dtoverlay=pi3-disable-bt
gpu_mem=256
dtoverlay=w1-gpio
enable_uart=1

View File

@ -481,3 +481,24 @@ fr_FR.UTF-8 UTF-8
# zh_TW.UTF-8 UTF-8
# zu_ZA ISO-8859-1
# zu_ZA.UTF-8 UTF-8
# agr_PE UTF-8
# az_IR UTF-8
# bho_NP UTF-8
# bi_VU UTF-8
# ca_ES@valencia UTF-8
# dsb_DE UTF-8
# el_GR@euro ISO-8859-7
# en_SC.UTF-8 UTF-8
# hif_FJ UTF-8
# kab_DZ UTF-8
# mai_NP UTF-8
# mfe_MU UTF-8
# miq_NI UTF-8
# mjw_IN UTF-8
# mnw_MM UTF-8
# sah_RU UTF-8
# shn_MM UTF-8
# sm_WS UTF-8
# to_TO UTF-8
# tpi_PG UTF-8
# yuw_PG UTF-8

View File

@ -1,35 +0,0 @@
- name: Add apt key
apt_key:
url: https://download.docker.com/linux/debian/gpg
- name: Add docker-ce repository
apt_repository:
repo: deb [arch={{ arch | default('armhf') }}] https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable
state: present
filename: 'docker'
- meta: flush_handlers
- name: Install docker-ce
apt:
name:
- python3-pip
- docker-ce
- xfsprogs
state: present
- name: Set groups to pi user
user:
name: pi
groups: docker
- meta: flush_handlers
- name: Install ansible tool docker and docker-compose
pip:
name:
- docker-compose
executable: pip3

View File

@ -1,4 +0,0 @@
---
- include_tasks: docker.yml

View File

@ -1,13 +0,0 @@
---
donkey_username: pi
donkey_groupname: pi
donkey_home_dir: /home/{{ donkey_username }}
donkey_git_repo: https://github.com/cyrilix/donkey.git
donkey_git_branch: master
donkey_sources: "{{ donkey_home_dir }}/donkeycar"
donkey_virtualenv_dir: "{{ donkey_home_dir }}/venv"
donkey_data_dir: "{{ donkey_home_dir }}/data"

View File

@ -1,16 +0,0 @@
---
- name: Make data directory
file:
path: "{{ donkey_data_dir }}"
owner: "{{ donkey_username }}"
group: "{{ donkey_groupname }}"
state: directory
- name: Make tmpfs
mount:
path: "{{ donkey_data_dir }}"
src: tmpfs
fstype: tmpfs
opts: defaults
state: mounted

View File

@ -1,62 +0,0 @@
---
- include_tasks: data.yml
- name: Install dependencies
apt:
name:
- python3-setuptools-git
- virtualenv
- libopenjp2-7
- libtiff5
- libblas3
- liblapack3
- libatlas3-base
- libjpeg-dev
- libilmbase12
- libopenexr22
- libgstreamer1.0-0
- libavcodec57
- libavformat57
- libswscale4
- libgtk-3-0
- i2c-tools
- read-edid
- libsdl1.2debian
- libjasper1
- libqtgui4
- libqt4-test
- python-h5py
state: present
- name: Fetch git repository
become_user: "{{ donkey_username }}"
git:
repo: "{{ donkey_git_repo }}"
dest: "{{ donkey_sources }}"
version: "{{ donkey_git_branch }}"
ssh_opts: "-o StrictHostKeyChecking=no"
- name: Install donkey
become_user: "{{ donkey_username }}"
pip:
name: "{{ donkey_sources }}"
virtualenv_python: python3
virtualenv: "{{ donkey_virtualenv_dir }}"
editable: yes
#- name: Install dependencies
# become_user: "{{ donkey_username }}"
# pip:
# requirements: "{{ donkey_sources }}/requirements-pi.txt"
# virtualenv: "{{ donkey_virtualenv_dir }}"
# virtualenv_python: python3
- name: Load virtualenv at connection
template:
src: bash_custom
dest: "{{ donkey_home_dir }}/.bash_custom"
owner: "{{ donkey_username }}"
group: "{{ donkey_groupname }}"
mode: 0644

View File

@ -1,2 +0,0 @@
# Activate virtualenv
source {{ donkey_virtualenv_dir }}/bin/activate

View File

@ -1,3 +1,3 @@
---
k3s_version: v1.22.5%2Bk3s1
k3s_version: v1.25.3%2Bk3s1
k3s_url: https://github.com/k3s-io/k3s/releases/download/{{ k3s_version }}/k3s-{{ arch | default('armhf') }}

View File

@ -26,4 +26,4 @@ RestartSec=5s
ExecStartPre=/bin/sh -xc '! /usr/bin/systemctl is-enabled --quiet nm-cloud-setup.service'
ExecStartPre=-/sbin/modprobe br_netfilter
ExecStartPre=-/sbin/modprobe overlay
ExecStart=/usr/local/bin/k3s server
ExecStart=/usr/local/bin/k3s server --disable traefik --disable-helm-controller

View File

@ -1,4 +0,0 @@
---
version: 3.6.6
threads: 4

View File

@ -1,52 +0,0 @@
---
- name: "Install python {{version}} runtime & build dependencies"
become: yes
apt: name={{item}}
with_items:
- build-essential
- tk-dev
- libncurses5-dev
- libncursesw5-dev
- libreadline6-dev
- libdb5.3-dev
- libgdbm-dev
- libsqlite3-dev
- libssl-dev
- libbz2-dev
- libexpat1-dev
- liblzma-dev
- libffi-dev
- uuid-dev
- zlib1g-dev
- name: "Download python{{version}}"
get_url:
url: "https://www.python.org/ftp/python/{{version}}/Python-{{version}}.tar.xz"
dest: "/tmp/Python-{{version}}.tar.xz"
- name: "Unarchive python{{version}}"
unarchive:
src: "/tmp/Python-{{version}}.tar.xz"
dest: "/tmp/"
copy: no
creates: "/tmp/Python-{{version}}"
- name: "configure python{{version}} build"
command: ./configure --prefix=/opt/python-{{version}} --enable-optimizations
args:
chdir: "/tmp/Python-{{version}}"
creates: "/tmp/Python-{{version}}/Makefile"
- name: "build python{{version}}"
# not using make module to be able to use -j and creates option to fully skip step
command: make -j{{threads}}
args:
chdir: "/tmp/Python-{{version}}"
creates: "/tmp/Python-{{version}}/python"
- name: "install python{{version}}"
become: yes
make:
chdir: "/tmp/Python-{{version}}"
target: altinstall

View File

@ -1,11 +0,0 @@
---
- name: expand filesystem
shell: resize2fs /dev/mmcblk0p2
notify:
- reboot
- name: restart rabbitmq
service:
name: rabbitmq-server
start: restarted

View File

@ -1,35 +0,0 @@
---
- name: Install ansible dependencies
apt:
name: "python3-requests"
state: present
- name: Install rabbitmq package
apt:
name: rabbitmq-server
state: present
with_items:
- rabbitmq-server
- python3-requests
- name: Enables rabbitmq plugins
rabbitmq_plugin:
names: rabbitmq_management,rabbitmq_mqtt
state: enabled
- name: Add rabbitmq user
rabbitmq_user:
user: "{{ rabbitmq_user }}"
password: "{{ rabbitmq_password }}"
vhost: /
configure_priv: .*
read_priv: .*
write_priv: .*
tags: administrator
state: present
- name: Create exchange
rabbitmq_exchange:
name: car
type: topic
vhost: "/"

View File

@ -8,13 +8,5 @@
- hosts: microservice
become: yes
roles:
- { role: rabbitmq, tags: [rabbitmq] }
- { role: k3s, tags: [k3s] }
- { role: microservices, tags: [microservices, ms] }
- hosts: donkey
become: yes
roles:
- { role: python, tags: [python]}
- { role: donkey, tags: [donkey] }