您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
此仓库已存档。您可以查看文件和克隆,但不能推送或创建工单/合并请求。

48 行
1.1KB

  1. ---
  2. - setup:
  3. gather_subset: '!all'
  4. when: not root_target_directory is defined
  5. - apt:
  6. pkg: dbus
  7. state: present
  8. when:
  9. - not root_target_directory is defined
  10. - ansible_os_family == "Debian"
  11. - name: hostname
  12. hostname:
  13. name: "{{inventory_hostname}}"
  14. when: not root_target_directory is defined
  15. - name: etc directory
  16. file:
  17. path: "{{ root_target_directory }}/etc"
  18. state: directory
  19. when: root_target_directory is defined
  20. - name: hostname file
  21. copy:
  22. content: "{{inventory_hostname}}"
  23. dest: "{{ root_target_directory }}/etc/hostname"
  24. when: root_target_directory is defined
  25. - name: hosts file
  26. file:
  27. path: "{{ root_target_directory }}/etc/hosts"
  28. state: touch
  29. when: root_target_directory is defined
  30. - name: localhost ipv4 entry
  31. lineinfile:
  32. dest: "{{ root_target_directory | default('') }}/etc/hosts"
  33. regexp: '^127\.0\.0\.1'
  34. line: "127.0.0.1 localhost {{inventory_hostname}}"
  35. - name: localhost ipv6 entry
  36. lineinfile:
  37. dest: "{{ root_target_directory | default('') }}/etc/hosts"
  38. regexp: '^::1'
  39. line: "::1 localhost ip6-localhost ip6-loopback {{inventory_hostname}}"