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.
 
 
 
 
 
 

29 lines
895 B

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