lisael.ansible_traefikee
Traefikee
Zainstaluj i skonfiguruj klaster TraefikEE na własnym serwerze
Zmienne roli
Z domyślnych ustawień (pomińmy nudne rzeczy, zajrzyj do pliku dla szczegółowych ustawień, takich jak ścieżka instalacji, nazwa usługi systemd, polecenia uruchamiające itp.):
# Nazwy grup w inwentarzu dla kontrolerów i proxy
traefikee_controller_group: traefikee_controller
traefikee_proxy_group: traefikee_proxy
# Ustawiane na true tylko podczas instalacji klastra.
traefikee_install: false # true, aby zainstalować pliki binarne traefikee
traefikee_configure: false # true, aby skonfigurować i uruchomić usługi systemd
# Dynamiczna konfiguracja
# każdy wpis to plik konfiguracyjny. Jeśli konfiguracja jest ustawiona na false,
# plik konfiguracyjny jest usuwany
#
# przykład:
# traefikee_cluster_dynamic_config:
# my_site:
# http:
# routers:
# my-site-router:
# rule: "Host('www.example.org')"
# entryPoints:
# - https
# service: site
# services:
# site:
# loadBalancer:
# servers:
# - url: "http://10.0.0.42:8000"
# my_old_site: null
traefikee_cluster_dynamic_config: {}
# Uzyskaj klucz licencyjny, kontaktując się z zespołem sprzedaży Containous
traefikee_license_key: ""
# Informacje o pobieraniu plików binarnych
traefikee_version: 2.0.2
traefikee_arch: linux_amd64
# Przy uruchamianiu, traefikee sprawdza licencję. To jest dodawane jako
# zmienne środowiskowe systemd.
traefikee_http_proxy: ""
traefikee_https_proxy: "{{ traefikee_http_proxy }}"
# Dodaj dodatkowe zmienne środowiskowe tutaj.
# np. dla konfiguracji Lego (https://docs.traefik.io/https/acme/) :
# traefikee_environment_extra: |
# OVH_ENDPOINT=ovh-eu
# OVH_APPLICATION_KEY=123456
# OVH_APPLICATION_SECRET=123456
# OVH_CONSUMER_KEY=abcdef1234
traefikee_environment_extra: ""
# Staticzna konfiguracja jest wierną kopią tego mapowania
traefikee_cluster_config:
entryPoints:
http:
address: ":80"
https:
address: ":443"
providers:
# ten dostawca jest wymagany, jeśli chce się używać traefikee_cluster_dynamic_config
file:
directory: "{{ traefikee_cluster_dynamic_config_dir }}"
watch: true
Przykładowy playbook
Dany ten inwentarz:
all:
children:
traefikee:
vars:
# TODO: Obecnie jest to zakodowane na sztywno, musimy to uzyskać z faktów
traefikee_controller_listen_address: 10.108.0.18
# oczywiście to powinno być zaszyfrowane
traefikee_license_key: !vault |
**********
traefikee_http_proxy: http://mysquid:3128
children:
traefikee_controller:
hosts:
traefik-ctl-01.example.net:
traefikee_proxy:
hosts:
traefik-proxy-01.example.net:
traefik-proxy-02.example.net:
Zainstaluj i skonfiguruj klaster
- hosts: traefikee
become: yes
environment:
# te są wymagane, ponieważ proces instalacji łączy się z internetem
http_proxy: http://mysquid:3128
https_proxy: http://mysquid:3128
vars:
traefikee_install: yes
traefikee_configure: yes
roles:
- traefikee
Aktualizuj dynamiczną konfigurację
Zauważ, że stara konfiguracja remove_me
jest usuwana, podczas gdy my_site
jest tworzona lub aktualizowana.
- hosts: traefikee
become: yes
vars:
traefikee_cluster_dynamic_config:
remove_me: null
my_site:
http:
routers:
my-site-router:
rule: "Host('www.example.org')"
entryPoints:
- http
service: site
services:
site:
loadBalancer:
servers:
- url: "http://10.0.0.42:8000"
roles:
- traefikee
Licencja
© 2020 – Kosc Telecom
Dystrybuowane na podstawie warunków GPLV3
Zainstaluj
ansible-galaxy install lisael.ansible_traefikee
Licencja
Unknown
Pobrania
3.9k
Właściciel