소스 검색

Added role to handle installation and availability of the universe factory repo

Till Klocke 9 년 전
부모
커밋
c188cacb93

+ 38 - 0
roles/repo-universe-factory/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).

+ 4 - 0
roles/repo-universe-factory/defaults/main.yml

@@ -0,0 +1,4 @@
+---
+# defaults file for repo-universe-factory
+repo_universe_factory_unsupported_architecture: false
+repo_universe_factory_unsupported_distro: false

+ 2 - 0
roles/repo-universe-factory/handlers/main.yml

@@ -0,0 +1,2 @@
+---
+# handlers file for repo-universe-factory

+ 20 - 0
roles/repo-universe-factory/meta/main.yml

@@ -0,0 +1,20 @@
+---
+galaxy_info:
+  author: Till Klocke
+  description: Installs Universe Factory repository if possible
+  company: Freifunk Dortmund
+  license: MIT
+  min_ansible_version: 1.2
+  platforms:
+  - name: Ubuntu
+    versions:
+    - all
+  - name: Debian
+    versions:
+    - all
+  categories:
+  - system
+dependencies: []
+  # List your role dependencies here, one per line.
+  # Be sure to remove the '[]' above if you add dependencies
+  # to this list.

+ 37 - 0
roles/repo-universe-factory/tasks/main.yml

@@ -0,0 +1,37 @@
+---
+# tasks file for repo-universe-factory
+
+- name: Check architecture
+  when: ansible_architecture != 'i386' and ansible_architecture != 'amd64' and ansible_architecture !='x86_64'
+  set_fact: 
+    repo_universe_factory_unsupported_architecture: true
+
+- name: Check Distro
+  when: ansible_distribution != "Debian" and ansible_distribution != "Ubuntu"
+  set_fact:
+    repo_universe_factory_unsupported_distro: true
+
+- set_fact:
+    repo_universe_factory_available: true
+  when: not repo_universe_factory_unsupported_distro and not repo_universe_factory_unsupported_architecture
+
+- set_fact:
+    repo_universe_factory_available: false
+  when: repo_universe_factory_unsupported_distro or repo_universe_factory_unsupported_architecture
+
+- name: Add GPG key for Wheezy backports
+  when: ansible_distribution_release == 'wheezy' and repo_universe_factory_available
+  apt_key: keyserver=pgpkeys.mit.edu id=8B48AD6246925553
+
+- name: Add Wheezy backports
+  when: ansible_distribution_release == 'wheezy' and repo_universe_factory_available
+  apt_repository: repo='deb http://http.debian.net/debian wheezy-backports main' state=present update_cache=yes
+
+- name: Add Universe Factory GPG Key
+  when: repo_universe_factory_available
+  apt_key: keyserver=pgpkeys.mit.edu id=16EF3F64CB201D9C
+
+- name: Add Universe Factory Apt Repository 
+  when: repo_universe_factory_available
+  apt_repository: repo='deb http://repo.universe-factory.net/debian/ sid main' state=present update_cache=yes
+

+ 2 - 0
roles/repo-universe-factory/vars/main.yml

@@ -0,0 +1,2 @@
+---
+# vars file for repo-universe-factory