main.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # This role builds ISC KEA for running PostgreSQL as Database engine
  2. ---
  3. - name: Install required packages for building KEA
  4. apt:
  5. pkg: "{{ item }}"
  6. update_cache: yes
  7. cache_valid_time: 1800
  8. state: present
  9. install_recommends: no
  10. with_items:
  11. - git
  12. - g++
  13. - automake
  14. - autoconf
  15. - libtool
  16. - pkg-config
  17. - libboost-all-dev
  18. - openssl
  19. - libssl-dev
  20. - ca-certificates
  21. - liblog4cplus-dev
  22. - postgresql-server-dev-all
  23. - libpq-dev
  24. when: domaenenliste is defined
  25. - name: Clone ISC KEA git repo and checkout branch v1_2_0
  26. git: repo=https://github.com/isc-projects/kea.git dest=/srv/kea clone=yes update=no version=v1_2_0
  27. when: domaenenliste is defined
  28. - name: Build ISC KEA
  29. shell: "{{item}}"
  30. args:
  31. chdir: "/srv/kea"
  32. creates: "/usr/local/sbin/kea-dhcp4"
  33. with_items:
  34. - "autoreconf --install"
  35. - "./configure --with-dhcp-pgsql"
  36. - "make -j $(grep -ic 'model name' /proc/cpuinfo)"
  37. - "make install"
  38. - "ldconfig"
  39. when: domaenenliste is defined
  40. - name: Depoly systemd files
  41. template: src="{{item}}" dest="/lib/systemd/system/{{item[:-3]}}"
  42. with_items:
  43. - kea-dhcp4.service.j2
  44. - kea-dhcp6.service.j2
  45. - kea-dhcp-ddns.service.j2
  46. notify:
  47. - reload systemd
  48. when: domaenenliste is defined