ソースを参照

Role ff-supernode installs now the ffrl tools and installs the necessary cronjob

Till Klocke 9 年 前
コミット
0998bfb97b

+ 14 - 3
roles/ff-supernode/tasks/main.yml

@@ -24,8 +24,19 @@
 - name: Install ntp.conf
   template: src=ntp.conf.j2 dest=/etc/ntp.conf
 
+- name: Install python dependencies for ffrl tools
+  pip: name={{item}} executable=pip3
+  with_items:
+  - pyroute2
+
 - name: Create install dir for ffrl tools
-  file: dest={{supernode_freifunk_tools_dir}} state=directory
+  file: dest={{supernode_freifunk_tools_dir}} state= directory
+
+- name: Clone ffrl tools
+  git: repo={{supernode_freifunk_tools_repo}} dest={{supernode_freifunk_tools_dir}}
 
-- name: Install ffrl tools
-  git: repo={{supernode_freifunk_tools_repo}} dest={{supernode_freifunk_tools_dir}}
+- name: Install nodeinfo cron job
+  cron: 
+    name: nodeinfo.py 
+    job: "{{supernode_freifunk_tools_dir}}/nodeinfo/nodeinfo.py | gzip | alfred -s 158"
+    user: root

+ 1 - 0
test/integration/supernode/serverspec/test_spec.rb

@@ -2,6 +2,7 @@ require 'serverspec'
 
 describe cron do
   it { should have_entry '*/5 * * * * wget -q -O /etc/fastd/fastd-blacklist.json https://raw.githubusercontent.com/ffruhr/fastdbl/master/fastd-blacklist.json' }
+  it { should have_entry '* * * * * /src/ff-tools/nodeinfo/nodeinfo.py | gzip | alfred -s 158'}
 end
 
 describe user('fritz') do