31 lines
1.8 KiB
YAML
31 lines
1.8 KiB
YAML
---
|
|
- name: Deploy+Verify 04-07 nodejs Ingress + Traefik
|
|
hosts: k3s_server
|
|
become: true
|
|
run_once: true
|
|
vars:
|
|
k3s_kubeconfig: /etc/rancher/k3s/k3s.yaml
|
|
verify_teardown: "{{ (VERIFY_TEARDOWN | default('1')) | string }}"
|
|
nodejs_manifest_src: "{{ playbook_dir }}/../../files/04-07/04-07-nodejs-demo.yaml"
|
|
nodejs_manifest_dest: /tmp/nodejs-demo-04-07.yaml
|
|
nodejs_verify_entry_base: "{{ nodejs_entry_base | default('http://' ~ k3s_server_ip) }}"
|
|
nodejs_verify_path: "/node"
|
|
nodejs_verify_host: ""
|
|
_nodejs_tls_entry_base: "{{ NODEJS_TLS_ENTRY_BASE | default(lookup('env', 'NODEJS_TLS_ENTRY_BASE') | default('', true), true) | trim }}"
|
|
_nodejs_tls_host: "{{ NODEJS_TLS_HOST | default(lookup('env', 'NODEJS_TLS_HOST') | default('', true), true) | trim }}"
|
|
nodejs_tls_probe_enabled: "{{ (_nodejs_tls_entry_base | length > 0) and (_nodejs_tls_host | length > 0) and (_nodejs_tls_entry_base is match('^https?://')) }}"
|
|
_nodejs_tls_authority: "{{ _nodejs_tls_entry_base | regex_replace('^https?://', '') | regex_replace('/.*$', '') }}"
|
|
nodejs_tls_connect_host: "{{ _nodejs_tls_authority | regex_replace(':([0-9]+)$', '') }}"
|
|
nodejs_tls_connect_port: "{{ (_nodejs_tls_authority | regex_replace('^[^:]*:', '') | int) if (':' in _nodejs_tls_authority) else 443 }}"
|
|
nodejs_tls_sni_probe_enabled: "{{ nodejs_tls_probe_enabled | bool }}"
|
|
nodejs_tls_sni_connect_host: "{{ nodejs_tls_connect_host }}"
|
|
nodejs_tls_sni_port: "{{ nodejs_tls_connect_port }}"
|
|
nodejs_tls_sni_servername: "{{ _nodejs_tls_host }}"
|
|
nodejs_tls_sni_assertion_label: nodejs_04_07_tls_sni_handshake
|
|
nodejs_http_assertion_label: nodejs_04_07_entry_http
|
|
tasks:
|
|
- name: Include nodejs deploy+verify template
|
|
ansible.builtin.include_role:
|
|
name: verify_common
|
|
tasks_from: nodejs-demo-deploy-verify.yml
|