main.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. ---
  2. - name: Install dependencies
  3. become: true
  4. apt:
  5. pkg:
  6. - git
  7. - build-essential
  8. - make
  9. - name: Clone babeld git repo
  10. git:
  11. repo: https://github.com/jech/babeld.git
  12. dest: "/home/{{ system.user }}/babeld"
  13. clone: true
  14. force: true
  15. register: git_clone
  16. - name: Build babeld
  17. community.general.make:
  18. chdir: "/home/{{ system.user }}/babeld"
  19. params:
  20. NUM_THREADS: "{{ ansible_processor_vcpus }}"
  21. when: git_clone is changed
  22. - name: Install babeld
  23. become: true
  24. community.general.make:
  25. chdir: "/home/{{ system.user }}/babeld"
  26. target: install
  27. when: git_clone is changed
  28. - name: Install default parameter
  29. become: true
  30. copy:
  31. src: files/default-babeld
  32. dest: /etc/default/babeld
  33. mode: 0644
  34. - name: Install init script
  35. become: true
  36. copy:
  37. src: files/init-babeld
  38. dest: /etc/init.d/babeld
  39. mode: +x
  40. - name: Install logrotate settings
  41. become: true
  42. copy:
  43. src: files/logrotate-babeld
  44. dest: /etc/logrotate.d/babeld
  45. mode: 0644
  46. - name: Install Systemd unit
  47. become: true
  48. copy:
  49. src: files/systemd-babeld
  50. dest: /etc/systemd/system/babeld.service
  51. mode: 0644
  52. - name: Reload systemd
  53. become: true
  54. systemd:
  55. daemon_reload: true
  56. - name: Create empty babeld configuration file
  57. become: true
  58. file:
  59. path: /etc/babeld.conf
  60. state: touch
  61. mode: 0644