Преглед на файлове

Added first version of fastd role. This role should work on amd64 ubuntu systems and install fastd via apt

Till Klocke преди 9 години
родител
ревизия
295bc86e9c
променени са 6 файла, в които са добавени 151 реда и са изтрити 0 реда
  1. 38 0
      roles/fastd/README.md
  2. 10 0
      roles/fastd/defaults/main.yml
  3. 2 0
      roles/fastd/handlers/main.yml
  4. 33 0
      roles/fastd/meta/main.yml
  5. 66 0
      roles/fastd/tasks/main.yml
  6. 2 0
      roles/fastd/vars/main.yml

+ 38 - 0
roles/fastd/README.md

@@ -0,0 +1,38 @@
+Role Name
+=========
+
+A brief description of the role goes here.
+
+Requirements
+------------
+
+Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
+
+Role Variables
+--------------
+
+A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
+
+Dependencies
+------------
+
+A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
+
+Example Playbook
+----------------
+
+Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
+
+    - hosts: servers
+      roles:
+         - { role: username.rolename, x: 42 }
+
+License
+-------
+
+BSD
+
+Author Information
+------------------
+
+An optional section for the role authors to include contact information, or a website (HTML is not allowed).

+ 10 - 0
roles/fastd/defaults/main.yml

@@ -0,0 +1,10 @@
+---
+# defaults file for fastd
+fastd_repo: http://git.universe-factory.net/fastd/
+fastd_repo_tag: v17
+fastd_install_dir: /opt/fastd
+fastd_build_dir: /usr/src/fastd-build
+fastd_install_from_source: false
+fastd_libuecc_repo: git://git.universe-factory.net/libuecc
+fastd_libuecc_tag: v5
+fastd_libuecc_build_dir: /usr/src/libuecc-build

+ 2 - 0
roles/fastd/handlers/main.yml

@@ -0,0 +1,2 @@
+---
+# handlers file for fastd

+ 33 - 0
roles/fastd/meta/main.yml

@@ -0,0 +1,33 @@
+---
+galaxy_info:
+  author: Till Klocke
+  description: Install fastd
+  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: license (GPLv2, CC-BY, etc)
+  min_ansible_version: 1.2
+  #
+  # Below are all platforms currently available. Just uncomment
+  # the ones that apply to your role. If you don't see your 
+  # platform on this list, let us know and we'll get it added!
+  #
+  #platforms:
+  #
+  # Below are all categories currently available. Just as with
+  # the platforms above, uncomment those that apply to your role.
+  #
+  #categories:
+dependencies: []
+  # List your role dependencies here, one per line.
+  # Be sure to remove the '[]' above if you add dependencies
+  # to this list.
+  

+ 66 - 0
roles/fastd/tasks/main.yml

@@ -0,0 +1,66 @@
+---
+# tasks file for fastd
+
+- name: Check architecture
+  when: ansible_architecture != 'i386' and ansible_architecture != 'amd64'
+  set_fact: fastd_install_from_source=true
+
+- name: Add GPG key for Wheezy backports
+  when: ansible_distribution_release == 'wheezy'
+  apt_key: keyserver=pgpkeys.mit.edu id=8B48AD6246925553
+
+- name: Add Wheezy backports
+  when: ansible_distribution_release == 'wheezy'
+  apt_repository: repo='deb http://http.debian.net/debian wheezy-backports main' state=present update_cache=yes
+
+- name: Add GPG key for fastd Apt repo
+  apt_key: keyserver=pgpkeys.mit.edu id=16EF3F64CB201D9C
+
+- name: Add fastd Apt repo
+  apt_repository: repo='deb http://repo.universe-factory.net/debian/ sid main' state=present update_cache=yes
+
+- name: Install fastd build dependencies
+  when: fastd_install_from_source == 'true'
+  apt: name={{item}} update_cache=no
+  with_items:
+    - libcap2
+    - libcap-dev
+    - bison
+    - pkg-config
+    - cmake
+    - libssl1.0.0
+    - libssl-dev
+    - libsodium-dev
+    - libsodium13
+    - git
+
+- name: Clone libuecc repo
+  when: fastd_install_from_source == 'true'
+  register: clonelibuecc
+  git: repo={{fastd_libuecc_repo}} dest=/usr/src/libuecc accept_hostkey=yes version={{fastd_libuecc_tag}}
+
+- name: Clone fastd repo
+  when: fastd_install_from_source == 'true'
+  register: clonefastd
+  git: repo={{fastd_repo}} dest=/usr/src/fastd accept_hostkey=yes version={{fastd_repo_tag}}
+
+- name: Create build dirs
+  when: clonelibuecc|changed
+  register: builddircreated
+  file: path={{item}} state=directory
+  with_items:
+    - "{{fastd_libuecc_build_dir}}"
+    - "{{fastd_build_dir}}"
+
+- name: Build and install libuecc
+  when: builddircreated|changed
+  command: cmake /usr/src/libuecc && make && make install chdir={{fastd_libuecc_build_dir}}
+
+- name: Build and install fastd
+  when: builddircreated|changed
+  command: cmake /usr/src/fastd && make && make install chdir={{fastd_build_dir}}
+
+- name: Install fastd via Apt
+  when: fastd_install_from_source != 'true'
+  apt: name=fastd state=latest
+

+ 2 - 0
roles/fastd/vars/main.yml

@@ -0,0 +1,2 @@
+---
+# vars file for fastd