您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

43 行
1.3KB

  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"