You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

2 anni fa
2 anni fa
12345678910111213141516171819
  1. ---
  2. - name: hostname
  3. hostname:
  4. name: "{{inventory_hostname}}"
  5. when: not root_target_directory is defined
  6. - name: localhost ipv4 entry
  7. lineinfile:
  8. dest: "{{ root_target_directory | default('') }}/etc/hosts"
  9. regexp: '^127\.0\.0\.1'
  10. line: "127.0.0.1 localhost {{inventory_hostname}}{% if inventory_hostname != inventory_hostname_short %} {{inventory_hostname_short}}{% endif %}"
  11. - name: localhost ipv6 entry
  12. lineinfile:
  13. dest: "{{ root_target_directory | default('') }}/etc/hosts"
  14. regexp: '^::1'
  15. line: "::1 localhost ip6-localhost ip6-loopback {{inventory_hostname}}{% if inventory_hostname != inventory_hostname_short %} {{inventory_hostname_short}}{% endif %}"