Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
Este repositório está arquivado. Você pode visualizar os arquivos e realizar clone, mas não poderá realizar push nem abrir issues e pull requests.

hostname.yaml 807B

123456789101112131415161718192021222324252627282930
  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}}"