25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.7KB

  1. ---
  2. - include_tasks: setup_{{ansible_os_family}}.yml
  3. when: not root_target_directory is defined
  4. - name: set netifs
  5. set_fact:
  6. _netifs: "{{ lookup('template','netifs.json.j2') }}"
  7. - name: /etc/network directory
  8. file:
  9. path: "{{ root_target_directory | default('') }}/etc/network"
  10. state: directory
  11. - name: debian network interfaces configuration
  12. template:
  13. src: network-interfaces-debian.j2
  14. dest: "{{ root_target_directory | default('') }}/etc/network/interfaces"
  15. when:
  16. - ( root_target_dist | default('debian') ) == "debian"
  17. - name: alpine network interfaces configuration
  18. template:
  19. src: network-interfaces-alpine.j2
  20. dest: "{{ root_target_directory | default('') }}/etc/network/interfaces"
  21. when:
  22. - ( root_target_dist | default('debian') ) == "alpine"
  23. - name: /etc/network/interfaces.d directory
  24. file:
  25. path: "{{ root_target_directory | default('') }}/etc/network/interfaces.d"
  26. state: directory
  27. when:
  28. - ( root_target_dist | default('debian') ) == "debian"
  29. - name: debian network interface configuration
  30. template:
  31. src: network-interface-debian.j2
  32. dest: "{{ root_target_directory | default('') }}/etc/network/interfaces.d/{{ item }}"
  33. with_items: "{{ _netifs }}"
  34. when:
  35. - ( root_target_dist | default('debian') ) == "debian"
  36. - name: systemd network dir
  37. file:
  38. path: "{{ root_target_directory | default('') }}/etc/systemd/network"
  39. state: directory
  40. - name: systemd network interface names
  41. template:
  42. src: systemd-network.link.j2
  43. dest: "{{ root_target_directory | default('') }}/etc/systemd/network/10-{{ item }}.link"
  44. with_items: "{{ _netifs }}"
  45. when:
  46. - ( root_target_dist | default('debian') ) == "debian"