소스 검색

ansible: add rules to install and start mavproxy.

Michael Hope 10 달 전
부모
커밋
0f914e3655
3개의 변경된 파일26개의 추가작업 그리고 5개의 파일을 삭제
  1. 1 0
      ansible/roles/pi/tasks/main.yml
  2. 12 5
      ansible/roles/pi/tasks/mavlink.yml
  3. 13 0
      ansible/roles/pi/templates/mavproxy.service

+ 1 - 0
ansible/roles/pi/tasks/main.yml 파일 보기

@@ -3,6 +3,7 @@
3 3
 #   action: apt update_cache=yes
4 4
 # - name: Upgrade APT to the lastest packages
5 5
 #   action: apt upgrade=safe
6
+- include: mavlink.yml
6 7
 - include: accesspoint.yml
7 8
 - name: Set the hostname
8 9
   hostname: name="pi-{{hostid}}"

+ 12 - 5
ansible/roles/pi/tasks/mavlink.yml 파일 보기

@@ -1,9 +1,16 @@
1 1
 ---
2
-- name: Install MAVProxy dependencies
2
+- name: Install mavproxy dependencies
3 3
   apt: name=python-dev,python-setuptools,python-serial,python-pip,python-lxml
4
-- name: Install MAVProxy pip dependencies
4
+- name: Install mavproxy pip dependencies
5 5
   pip: name=future
6
-- name: Install MAVProxy pip dependencies
6
+- name: Install mavproxy pip dependencies
7 7
   pip: name=pyserial
8
-- name: Install Python 3 MAVProxy dependencies
9
-  apt: name=python3,python3-dev,python3-setuptools,python3-serial,python3-pip
8
+- name: Install mavproxy
9
+  pip: name=mavproxy
10
+- name: Make the run directory
11
+  file: path=/var/log/mavproxy state=directory owner=juju
12
+- name: Copy the service config
13
+  template: src=mavproxy.service dest=/lib/systemd/system/mavproxy.service
14
+- name: Enable mavproxy
15
+  systemd: name=mavproxy daemon_reload=yes enabled=yes masked=no
16
+  

+ 13 - 0
ansible/roles/pi/templates/mavproxy.service 파일 보기

@@ -0,0 +1,13 @@
1
+[Unit]
2
+Description=mavproxy
3
+After=network.target
4
+
5
+[Service]
6
+ExecStart=/usr/local/bin/mavproxy.py --daemon --default-modules=mavlink --out=udpbcast:192.168.0.255:14550
7
+WorkingDirectory=/var/log/mavproxy
8
+Restart=always
9
+RestartSec=2s
10
+User=juju
11
+
12
+[Install]
13
+WantedBy=multi-user.target