Explorar el Código

Added role for libuecc

Till Klocke hace 9 años
padre
commit
889a62a725

+ 38 - 0
roles/libuecc/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).

+ 8 - 0
roles/libuecc/defaults/main.yml

@@ -0,0 +1,8 @@
+---
+# defaults file for libsodium
+libuecc_build_from_source: true
+libuecc_version: v5
+libuecc_repo: git://git.universe-factory.net/libuecc
+libuecc_repo_dir: /usr/src/libuecc
+libuecc_build_dir: /usr/src/libuecc-build
+

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

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

+ 17 - 0
roles/libuecc/meta/main.yml

@@ -0,0 +1,17 @@
+---
+galaxy_info:
+  author: Till Klocke
+  description: Installs libuec
+  company: Freifunk Dortmund
+  license: MIT
+  min_ansible_version: 1.2
+  platforms:
+  - name: Ubuntu
+    versions:
+    - all
+  - name: Debian
+    versions:
+    - all
+  categories:
+  - system
+dependencies: []

+ 29 - 0
roles/libuecc/tasks/debian.yml

@@ -0,0 +1,29 @@
+- name: Check Debian version
+  set_fact: libuecc_build_from_source=true
+  when: ansible_lsb.major_release|int < 7
+
+- 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 libuecc Apt repo
+  when: libuecc_build_from_source != 'true'
+  apt_key: keyserver=pgpkeys.mit.edu id=16EF3F64CB201D9C
+
+- name: Add libuecc Apt repo
+  when: libuecc_build_from_source != 'true'
+  apt_repository: repo='deb http://repo.universe-factory.net/debian/ sid main' state=present update_cache=yes
+
+- name: Install libuecc via Apt
+  when: libuecc_build_from_source != 'true'
+  apt: name={{item}} state=latest update_cache=yes
+  with_items:
+  - libuecc0
+  - libuecc-dev
+
+- include: source.yml
+  when: libuecc_build_from_source == 'true'

+ 12 - 0
roles/libuecc/tasks/main.yml

@@ -0,0 +1,12 @@
+---
+# tasks file for libsodium
+
+- name: Check architecture
+  when: ansible_architecture != 'i386' and ansible_architecture != 'amd64'
+  set_fact: libuecc_build_from_source=true
+
+- include: debian.yml
+  when: ansible_distribution == "Ubuntu"
+
+- include: debian.yml
+  when: ansible_distribution == "Debian"

+ 13 - 0
roles/libuecc/tasks/source.yml

@@ -0,0 +1,13 @@
+- name: Create dirs
+  file: dest={{item}} state=directory
+  with_items:
+  - "{{libuecc_repo_dir}}"
+  - "{{libuecc_build_dir}}"
+
+- name: Checkout
+  git: repo={{libuecc_repo}} dest={{libuecc_repo_dir}}/libuecc accept_hostkey=yes version={{libuecc_version}}
+
+- name: Build and install libuecc
+  shell: cmake {{libuecc_repo_dir}} && make && make install
+  args:
+    chdir: "{{libuecc_build_dir}}"

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

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