main.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. - libsodium-dev
  28. - libsodium13
  29. - git
  30. - name: Clone libuecc repo
  31. when: fastd_install_from_source == 'true'
  32. register: clonelibuecc
  33. git: repo={{fastd_libuecc_repo}} dest=/usr/src/libuecc accept_hostkey=yes version={{fastd_libuecc_tag}}
  34. - name: Clone fastd repo
  35. when: fastd_install_from_source == 'true'
  36. register: clonefastd
  37. git: repo={{fastd_repo}} dest=/usr/src/fastd accept_hostkey=yes version={{fastd_repo_tag}}
  38. - name: Create build dirs
  39. when: clonelibuecc|changed
  40. register: builddircreated
  41. file: path={{item}} state=directory
  42. with_items:
  43. - "{{fastd_libuecc_build_dir}}"
  44. - "{{fastd_build_dir}}"
  45. - name: Build and install libuecc
  46. when: builddircreated|changed
  47. command: cmake /usr/src/libuecc && make && make install chdir={{fastd_libuecc_build_dir}}
  48. - name: Build and install fastd
  49. when: builddircreated|changed
  50. command: cmake /usr/src/fastd && make && make install chdir={{fastd_build_dir}}
  51. - name: Install fastd via Apt
  52. when: fastd_install_from_source != 'true'
  53. apt: name=fastd state=latest