From e4cd88e10a6a9bad97d3fb616f69a96c842b4d98 Mon Sep 17 00:00:00 2001 From: Lars Beckers <lars.beckers@rwth-aachen.de> Date: Wed, 4 Jul 2018 22:52:44 +0200 Subject: [PATCH] fix hosts template --- basic-system/templates/hosts.j2 | 12 ++++----- shell/tasks/shell.yml | 44 ++++++++++++++++----------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/basic-system/templates/hosts.j2 b/basic-system/templates/hosts.j2 index 9301e37..cdfed95 100644 --- a/basic-system/templates/hosts.j2 +++ b/basic-system/templates/hosts.j2 @@ -6,15 +6,15 @@ ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts -{%- for host in hosts_alternates %} +{% for host in hosts_alternates %} {{ host }} {{ ansible_host }} {{ inventory_hostname }} {% else %} {{ ansible_default_ipv4.address }} {{ ansible_host }} {{ inventory_hostname }} -{%- if address in ansible_default_ipv6 %} +{% if 'address' in ansible_default_ipv6 %} {{ ansible_default_ipv6.address }} {{ ansible_host }} {{ inventory_hostname }} -{% endif -%} -{% endfor -%} +{% endif %} +{% endfor %} -{%- for host in hosts_additionals %} +{% for host in hosts_additionals %} {{ host.address }} {{ host.names|join(' ') }} -{% endfor -%} +{% endfor %} diff --git a/shell/tasks/shell.yml b/shell/tasks/shell.yml index 3e1bae0..464c217 100644 --- a/shell/tasks/shell.yml +++ b/shell/tasks/shell.yml @@ -59,28 +59,28 @@ - packages - shell -- name: ensure we have an up-to-date version of grml-zsh-config - get_url: - url: https://www.archlinux.org/packages/extra/any/grml-zsh-config/download/ - dest: "{{ role_path }}/files/" - delegate_to: localhost - run_once: True - register: grml_zsh - tags: - - config - - shell - -- name: ensure grml-zsh-config is available - unarchive: - src: "{{ grml_zsh.dest }}" - dest: / - extra_opts: "--exlcude=.[A-Z]*" - when: - - grml_zsh.changed - - not grml_zsh.failed - tags: - - config - - shell + #- name: ensure we have an up-to-date version of grml-zsh-config + # get_url: + # url: https://www.archlinux.org/packages/extra/any/grml-zsh-config/download/ + # dest: "{{ role_path }}/files/" + # delegate_to: localhost + # run_once: True + # register: grml_zsh + # tags: + # - config + # - shell + # + #- name: ensure grml-zsh-config is available + # unarchive: + # src: "{{ grml_zsh.dest }}" + # dest: / + # extra_opts: "--exlcude=.[A-Z]*" + # when: + # - grml_zsh.changed + # - not grml_zsh.failed + # tags: + # - config + # - shell - name: ensure root uses the global zshrc copy: -- GitLab