main.yml 2.0 KB

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