main.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. ---
  2. # tasks file for fastd
  3. - name: Check architecture
  4. when: ansible_architecture != 'i386' and ansible_architecture != 'amd64'
  5. set_fact: fastd_install_from_source=true
  6. - name: Add GPG key for Wheezy backports
  7. when: ansible_distribution_release == 'wheezy'
  8. apt_key: keyserver=pgpkeys.mit.edu id=8B48AD6246925553
  9. - name: Add Wheezy backports
  10. when: ansible_distribution_release == 'wheezy'
  11. apt_repository: repo='deb http://http.debian.net/debian wheezy-backports main' state=present update_cache=yes
  12. - name: Add GPG key for fastd Apt repo
  13. apt_key: keyserver=pgpkeys.mit.edu id=16EF3F64CB201D9C
  14. - name: Add fastd Apt repo
  15. apt_repository: repo='deb http://repo.universe-factory.net/debian/ sid main' state=present update_cache=yes
  16. - name: Install fastd build dependencies
  17. when: fastd_install_from_source == 'true'
  18. apt: name={{item}} update_cache=no
  19. with_items:
  20. - libcap2
  21. - libcap-dev
  22. - bison
  23. - pkg-config
  24. - cmake
  25. - libssl1.0.0
  26. - libssl-dev
  27. - git
  28. - build-essential
  29. - name: Clone fastd repo
  30. when: fastd_install_from_source == 'true'
  31. register: clonefastd
  32. git: repo={{fastd_repo}} dest=/usr/src/fastd accept_hostkey=yes version={{fastd_repo_tag}}
  33. - name: Create build dirs
  34. when: clonelibuecc|changed
  35. register: builddircreated
  36. file: path={{item}} state=directory
  37. with_items:
  38. - "{{fastd_build_dir}}"
  39. - name: Build and install fastd
  40. when: builddircreated|changed
  41. command: cmake /usr/src/fastd && make && make install chdir={{fastd_build_dir}}
  42. - name: Install fastd via Apt
  43. when: fastd_install_from_source != 'true'
  44. apt: name=fastd state=latest