main.yml 964 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. - name: check for ifupdown2
  2. stat: path=/sbin/ifreload
  3. register: ifreload
  4. - name: install dependencies (for compilation and runtime)
  5. apt:
  6. pkg: "{{ item }}"
  7. state: installed
  8. with_items:
  9. - python-all
  10. - debhelper
  11. - dh-systemd
  12. - python-ipaddr
  13. - python-argcomplete
  14. when: ifreload.stat.exists == False
  15. - name: clone repository
  16. git:
  17. repo: 'https://github.com/CumulusNetworks/ifupdown2.git'
  18. dest: /opt/ifupdown2
  19. version: debian-prep2
  20. update: yes
  21. force: yes
  22. when: ifreload.stat.exists == False
  23. - name: compile and create deb
  24. shell: "dpkg-buildpackage -us -uc -rfakeroot -b"
  25. args:
  26. chdir: "/opt/ifupdown2"
  27. when: ifreload.stat.exists == False
  28. - name: remove ifupdown1
  29. apt:
  30. pkg: ifupdown
  31. state: absent
  32. when: ifreload.stat.exists == False
  33. - name: install created deb package
  34. shell: "dpkg -i /opt/ifupdown2*deb"
  35. when: ifreload.stat.exists == False