Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
etc-hosts.j2 1.27 KiB
Newer Older
  • Learn to ignore specific revisions
  • #jinja2:lstrip_blocks: True
    # ############################################# #
    #       This file is managed by Ansible         #
    #       Manual edition will be overridden       #
    #  https://lab.frogg.it/freezed/ansible-debian  #
    # ############################################# #
    
    127.0.0.1	localhost
    127.0.1.1	{{ inventory_fqdn }}	{{ inventory_hostname }}
    {{ ansible_host }}	{{ inventory_fqdn }}	{{ inventory_hostname }}
    
    {% if inventory_hostname in groups['station'] or inventory_hostname in groups['backup'] %}
    # WAN
        {% for host in groups['production'] %}
    {{ hostvars[host]['ansible_host'] }}	{{ hostvars[host]['inventory_fqdn'] }}	{{ host }}
        {% endfor %}
    {% endif %}
    
    {% if inventory_hostname in groups['station'] or inventory_hostname in groups['production'] %}
    # BKP
        {% for host in groups['backup'] %}
    {{ hostvars[host]['ansible_host'] }}	{{ hostvars[host]['inventory_fqdn'] }}	{{ host }}
        {% endfor %}
    {% endif %}
    
    {% if inventory_hostname in groups['station'] %}
    # DEV
        {% for host in groups['devel'] %}
    {{ hostvars[host]['ansible_host'] }}	{{ hostvars[host]['inventory_fqdn'] }}	{{ host }}
        {% endfor %}
    
    # LOCAL
        {% for host in groups['station'] %}
    {{ hostvars[host]['ansible_host'] }}	{{ hostvars[host]['inventory_fqdn'] }}	{{ host }}
        {% endfor %}
    {% endif %}