lisael.ansible_traefikee

Traefikee

オンプレミスのクラスターにTraefikEEをインストールして設定する

役割の変数

デフォルトから(退屈な部分は省略、インストールパス、systemdサービス名、起動コマンドラインなどの詳細な調整はファイルを参照してください):


# コントローラーとプロキシのためのインベントリ内のグループ名
traefikee_controller_group: traefikee_controller
traefikee_proxy_group: traefikee_proxy

# クラスターのインストール時のみtrueに設定されます。
traefikee_install: false  # traefikeeバイナリをインストールする場合はtrue
traefikee_configure: false  # systemdサービスを設定して開始する場合はtrue

# 動的設定
# 各エントリは設定ファイルです。設定がfalseと評価されると
# 設定ファイルは削除されます
#
# 例:

# 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: {}

# Containousの営業チームに連絡してライセンスキーを取得
traefikee_license_key: ""

# バイナリのダウンロード情報
traefikee_version: 2.0.2
traefikee_arch: linux_amd64

# 起動時にtraefikeeがライセンスチェックのために接続します。これは
# systemdサービスの環境変数として追加されます。
traefikee_http_proxy: ""
traefikee_https_proxy: "{{ traefikee_http_proxy }}"

# 追加の環境変数をここに追加します。
# 例えば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: ""

# 静的設定はこのマッピングのそのままコピーです
traefikee_cluster_config:
  entryPoints:
    http:
      address: ":80"
    https:
      address: ":443"
  providers:
    # traefikee_cluster_dynamic_configを使用する場合はこのプロバイダーが必要です
    file:
      directory: "{{ traefikee_cluster_dynamic_config_dir }}"
      watch: true

例のプレイブック

このインベントリを考慮してください:

all:
  children:
    traefikee:
      vars:
        # TODO: 現在はハードコーディングされていますので、これをファクトから取得する必要があります 
        traefikee_controller_listen_address: 10.108.0.18
        # 明らかに、これは暗号化されるべきです
        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:

クラスターのインストールと設定

- hosts: traefikee
  become: yes
  environment:
    # インストールプロセスはインターネットにアクセスするため、これらは必要です
    http_proxy: http://mysquid:3128
    https_proxy: http://mysquid:3128
  vars:
    traefikee_install: yes
    traefikee_configure: yes
  roles:
    - traefikee

動的設定の更新

古いremove_meの設定が削除され、新しいmy_siteが 作成または更新されます。

- 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

ライセンス

© 2020 – Kosc Telecom

GPLV3の条件で配布されています

プロジェクトについて

Install and configure a TraefikEE on-prem cluster

インストール
ansible-galaxy install lisael.ansible_traefikee
ライセンス
Unknown
ダウンロード
3.9k
所有者