ソースを参照

Role ff-supernode does now manage supervisor without the help of a third party role and installs the backport kernel for debian wheezy

Till Klocke 9 年 前
コミット
f9d53bbd2a

+ 7 - 1
roles/ff-supernode/handlers/main.yml

@@ -3,4 +3,10 @@
 # In Ubuntu restarting the networking service causes problems.
 # In Ubuntu restarting the networking service causes problems.
 # So we use ifdown and ifup to enable changes
 # So we use ifdown and ifup to enable changes
 - name: Restart network
 - name: Restart network
-  shell: ifdown --exclude=lo -a && ifup --exclude=lo -a
+  shell: ifdown --exclude=lo -a && ifup --exclude=lo -a
+
+- name: Restart supervisor
+  service: name=supervisor state=restarted
+
+- name: Reboot machine
+  shell: reboot

+ 0 - 10
roles/ff-supernode/meta/main.yml

@@ -3,16 +3,6 @@ galaxy_info:
   author: Till Klocke
   author: Till Klocke
   description: Installs a Freifunk Supernode
   description: Installs a Freifunk Supernode
   company: Freifunk Dortmund
   company: Freifunk Dortmund
-  # If the issue tracker for your role is not on github, uncomment the
-  # next line and provide a value
-  # issue_tracker_url: http://example.com/issue/tracker
-  # Some suggested licenses:
-  # - BSD (default)
-  # - MIT
-  # - GPLv2
-  # - GPLv3
-  # - Apache
-  # - CC-BY
   license: MIT
   license: MIT
   min_ansible_version: 1.2
   min_ansible_version: 1.2
   platforms:
   platforms:

+ 10 - 1
roles/ff-supernode/tasks/debian.yml

@@ -1,4 +1,13 @@
 - name: Make sure necessary tools are installed
 - name: Make sure necessary tools are installed
   apt: name={{item}} state=present
   apt: name={{item}} state=present
   with_items:
   with_items:
-  - wget
+  - wget
+  - supervisor
+
+- name: Install backport kernel for Debian wheezy
+  apt: name=linux-image-amd64 default_release=wheezy-backports state=latest
+  when: ansible_distribution_release == 'wheezy'
+  notify: Reboot machine
+
+- name: Start and enable supervisor
+  service: name=supervisor state=started enabled=yes

+ 6 - 1
roles/ff-supernode/tasks/main.yml

@@ -14,4 +14,9 @@
     job: wget -q -O /etc/fastd/fastd-blacklist.json https://raw.githubusercontent.com/ffruhr/fastdbl/master/fastd-blacklist.json
     job: wget -q -O /etc/fastd/fastd-blacklist.json https://raw.githubusercontent.com/ffruhr/fastdbl/master/fastd-blacklist.json
 
 
 - name: Install verify shell script
 - name: Install verify shell script
-  template: src=fastd-blacklist.sh.j2 dest=/etc/fastd/fastd-blacklist.sh mode="u=rwx,g=rx,o=r"
+  template: src=fastd-blacklist.sh.j2 dest=/etc/fastd/fastd-blacklist.sh mode="u=rwx,g=rx,o=r"
+
+- name: Create supervisor services
+  template: src=supervisor.service.j2 dest=/etc/supervisor/conf.d/{{item.name}}.conf
+  with_items: "{{supervisor_services}}"
+  notify: Restart supervisor

+ 3 - 0
roles/ff-supernode/templates/supervisor.service.j2

@@ -0,0 +1,3 @@
+[program:{{item.name}}]
+command={{item.command}}
+stdout_logfile=NONE

+ 5 - 1
roles/ff-supernode/vars/main.yml

@@ -38,4 +38,8 @@ radvd_default_interface_options: |
 
 
 radvd_default_interface_nameservers:
 radvd_default_interface_nameservers:
   - rdnss: 
   - rdnss: 
-    - "{{supernode_mesh_ipv6}}"
+    - "{{supernode_mesh_ipv6}}"
+
+supervisor_services:
+  - name: alfred
+    command: /usr/local/sbin/alfred -i alfred0