You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

32 lines
975 B

  1. ---
  2. - hosts: all
  3. vars:
  4. sudo: yes
  5. tasks:
  6. - name: assert debian
  7. assert:
  8. that: "ansible_os_family == 'Debian'"
  9. - name: add line to source interfaces.d
  10. lineinfile: dest=/etc/network/interfaces
  11. line="source-directory interfaces.d"
  12. backup=yes
  13. - name: comment allow-hotplug eth0
  14. lineinfile: dest=/etc/network/interfaces
  15. line="# allow-hotplug eth0"
  16. regexp="allow-hotplug eth0"
  17. backup=yes
  18. - name: comment dhcp setup for eth0
  19. lineinfile: dest=/etc/network/interfaces
  20. line="# iface eth0 inet dhcp"
  21. regexp="iface eth0 inet dhcp"
  22. backup=yes
  23. - name: put interfaces file for static IP
  24. copy: src=debian_setup.static_ip.interfaces
  25. dest=/etc/network/interfaces.d/static_ip
  26. notify:
  27. - restart networking service
  28. handlers:
  29. - name: restart networking service
  30. service: name=networking state=restarted