소스 검색

fastd, libsodium and libuecc role now depend on the repo-universe-factory role to decide wether to install packages via apt or from source

Till Klocke 9 년 전
부모
커밋
09c0868926

+ 1 - 4
roles/fastd/defaults/main.yml

@@ -4,7 +4,4 @@ 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
+fastd_install_from_source: false

+ 3 - 2
roles/fastd/meta/main.yml

@@ -12,5 +12,6 @@ galaxy_info:
   categories:
   - networking
 dependencies:
-   - libsodium
-   - libuecc
+  - repo-universe-factory
+  - libsodium
+  - libuecc

+ 5 - 18
roles/fastd/tasks/debian.yml

@@ -1,21 +1,5 @@
-- name: Add GPG key for Wheezy backports
-  when: ansible_distribution_release == 'wheezy' and not fastd_install_from_source
-  apt_key: keyserver=pgpkeys.mit.edu id=8B48AD6246925553
-
-- name: Add Wheezy backports
-  when: ansible_distribution_release == 'wheezy' and not fastd_install_from_source
-  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
-  when: not fastd_install_from_source
-  apt_key: keyserver=pgpkeys.mit.edu id=16EF3F64CB201D9C
-
-- name: Add fastd Apt repo
-  when: not fastd_install_from_source
-  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
+  when: not repo_universe_factory_available
   apt: name={{item}} update_cache=yes
   with_items:
     - libcap2
@@ -28,6 +12,9 @@
     - git
     - build-essential
 
+- include: source.yml
+  when: not repo_universe_factory_available
+
 - name: Install fastd via Apt
-  when: not fastd_install_from_source
+  when: repo_universe_factory_available
   apt: name=fastd state=latest

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

@@ -1,11 +1,6 @@
 ---
 # tasks file for fastd
 
-- name: Check architecture
-  when: ansible_architecture != 'i386' and ansible_architecture != 'amd64' and ansible_architecture !='x86_64'
-  set_fact:
-    fastd_install_from_source: true
-
 - include: debian.yml
   when: ansible_distribution == "Ubuntu"
 

+ 1 - 2
roles/fastd/tasks/source.yml

@@ -1,5 +1,4 @@
 - 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}}
 
@@ -12,4 +11,4 @@
 
 - name: Build and install fastd
   when: builddircreated|changed
-  command: cmake /usr/src/fastd && make && make install chdir={{fastd_build_dir}}
+  shell: cmake /usr/src/fastd && make && make install chdir={{fastd_build_dir}}

+ 2 - 1
roles/libsodium/meta/main.yml

@@ -14,4 +14,5 @@ galaxy_info:
     - all
   categories:
   - system
-dependencies: []
+dependencies:
+  - repo-universe-factory

+ 3 - 24
roles/libsodium/tasks/debian.yml

@@ -1,37 +1,16 @@
-- name: Check Debian version
-  when: ansible_lsb.major_release|int <= 6
-  set_fact:
-    libsodium_build_from_source: true
-
-- name: Add GPG key for Wheezy backports
-  when: ansible_distribution_release == 'wheezy' and not libsodium_build_from_source
-  apt_key: keyserver=pgpkeys.mit.edu id=8B48AD6246925553
-
-- name: Add Wheezy backports
-  when: ansible_distribution_release == 'wheezy' and not libsodium_build_from_source
-  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
-  when: ansible_distribution_release == 'wheezy' and not libsodium_build_from_source
-  apt_key: keyserver=pgpkeys.mit.edu id=16EF3F64CB201D9C
-
-- name: Add fastd Apt repo
-  when: ansible_distribution_release == 'wheezy' and not libsodium_build_from_source
-  apt_repository: repo='deb http://repo.universe-factory.net/debian/ sid main' state=present update_cache=yes
-
 - name: Install libsodium via Apt
-  when: not libsodium_build_from_source
+  when: repo_universe_factory_available
   apt: name={{item}} state=latest update_cache=yes
   with_items:
   - libsodium13
   - libsodium-dev
 
 - name: Install build dependencies for libsodium
-  when: libsodium_build_from_source
+  when: not repo_universe_factory_available
   apt: name={{item}} state=present
   with_items:
   - build-essential
   - autoconf
 
 - include: source.yml
-  when: libsodium_build_from_source
+  when: not repo_universe_factory_available

+ 0 - 5
roles/libsodium/tasks/main.yml

@@ -1,11 +1,6 @@
 ---
 # tasks file for libsodium
 
-- name: Check architecture
-  when: ansible_architecture != 'i386' and ansible_architecture != 'amd64' and ansible_architecture !='x86_64'
-  set_fact: 
-    libsodium_build_from_source: true
-
 - include: ubuntu.yml
   when: ansible_distribution == "Ubuntu"
 

+ 4 - 8
roles/libsodium/tasks/ubuntu.yml

@@ -1,13 +1,9 @@
-- name: Check Ubuntu version
-  set_fact: libsodium_build_from_source=true
-  when: ansible_lsb.major_release|int < 15
-
-- include: source.yml
-  when: libsodium_build_from_source == 'true'
-
 - name: Install libsodium via apt
-  when: libsodium_build_from_source != 'true'
+  when: repo_universe_factory_available
   apt: name={{item}} state=latest update_cache=yes
   with_items:
   - libsodium13
   - libsodium-dev
+
+- include: source.yml
+  when: not repo_universe_factory_available

+ 2 - 1
roles/libuecc/meta/main.yml

@@ -14,4 +14,5 @@ galaxy_info:
     - all
   categories:
   - system
-dependencies: []
+dependencies:
+  - repo-universe-factory

+ 3 - 24
roles/libuecc/tasks/debian.yml

@@ -1,33 +1,12 @@
-- name: Check Debian version
-  when: ansible_lsb.major_release|int < 7
-  set_fact: 
-    libuecc_build_from_source: true
-
-- name: Add GPG key for Wheezy backports
-  when: ansible_distribution_release == 'wheezy' and not libuecc_build_from_source
-  apt_key: keyserver=pgpkeys.mit.edu id=8B48AD6246925553
-
-- name: Add Wheezy backports
-  when: ansible_distribution_release == 'wheezy' and not libuecc_build_from_source
-  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: not libuecc_build_from_source
-  apt_key: keyserver=pgpkeys.mit.edu id=16EF3F64CB201D9C
-
-- name: Add libuecc Apt repo
-  when: not libuecc_build_from_source
-  apt_repository: repo='deb http://repo.universe-factory.net/debian/ sid main' state=present update_cache=yes
-
 - name: Install libuecc via Apt
-  when: not libuecc_build_from_source
+  when: repo_universe_factory_available
   apt: name={{item}} state=latest update_cache=yes
   with_items:
   - libuecc0
   - libuecc-dev
 
 - name: Install libuecc build dependencies
-  when: libuecc_build_from_source
+  when: not repo_universe_factory_available
   apt: name={{item}} state=present
   with_items:
   - cmake
@@ -35,4 +14,4 @@
   - git
 
 - include: source.yml
-  when: libuecc_build_from_source
+  when: not repo_universe_factory_available

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

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