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

31 行
807B

  1. ---
  2. - name: hostname
  3. hostname:
  4. name: "{{inventory_hostname}}"
  5. when: not root_target_directory is defined
  6. - name: hostname file
  7. copy:
  8. content: "{{inventory_hostname}}"
  9. dest: "{{ root_target_directory }}/etc/hostname"
  10. when: root_target_directory is defined
  11. - name: hosts file
  12. file:
  13. path: "{{ root_target_directory }}/etc/hosts"
  14. state: touch
  15. when: root_target_directory is defined
  16. - name: localhost ipv4 entry
  17. lineinfile:
  18. dest: "{{ root_target_directory | default('') }}/etc/hosts"
  19. regexp: '^127\.0\.0\.1'
  20. line: "127.0.0.1 localhost {{inventory_hostname}}"
  21. - name: localhost ipv6 entry
  22. lineinfile:
  23. dest: "{{ root_target_directory | default('') }}/etc/hosts"
  24. regexp: '^::1'
  25. line: "::1 localhost ip6-localhost ip6-loopback {{inventory_hostname}}"