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
ssh-config.j2 1.31 KiB
#jinja2:lstrip_blocks: True
# ############################################# #
#       This file is managed by Ansible         #
#  https://lab.frogg.it/freezed/ansible-debian  #
# ############################################# #

{% if inventory_hostname in groups['station'] or inventory_hostname in groups['backup'] %}
# WAN
    {% for host in groups['production'] %}
Host {{ host }}
  User {{ hostvars[host]['my_user'] }}
  Hostname {{ hostvars[host]['ansible_host'] }}
  Port {{ hostvars[host]['ansible_port'] }}
    {% endfor %}
{% endif %}

{% if inventory_hostname in groups['station'] or inventory_hostname in groups['production'] %}
# BKP
    {% for host in groups['backup'] %}
Host {{ host }}
  User {{ hostvars[host]['my_user'] }}
  Hostname {{ hostvars[host]['ansible_host'] }}
  Port {{ hostvars[host]['ansible_port'] }}
    {% endfor %}
{% endif %}

{% if inventory_hostname in groups['station'] %}
# DEV
    {% for host in groups['devel'] %}
Host {{ host }}
  User {{ hostvars[host]['my_user'] }}
  Hostname {{ hostvars[host]['ansible_host'] }}
  Port {{ hostvars[host]['ansible_port'] }}
    {% endfor %}

# LOCAL
    {% for host in groups['station'] %}
Host {{ host }}
  User {{ hostvars[host]['my_user'] }}
  Hostname {{ hostvars[host]['ansible_host'] }}
  Port {{ hostvars[host]['ansible_port'] }}
    {% endfor %}
{% endif %}