Add optional SMTP configuration for Authentik, including email host, port, and credentials. Update README and .env.sample to clarify usage for outbound email settings. Introduce blueprint support for enhanced deployment flexibility, with assertions in Ansible tasks to ensure required variables are set when enabled.
This commit is contained in:
@@ -349,3 +349,168 @@
|
||||
- noble_authentik_s3_addr_from_env is defined
|
||||
- (noble_authentik_s3_addr_from_env.stdout | default('') | trim | length) > 0
|
||||
no_log: true
|
||||
|
||||
# --- Optional SMTP (AUTHENTIK_EMAIL__* via Helm global.env) ---
|
||||
- name: Load NOBLE_AUTHENTIK_SMTP_HOST from .env when unset
|
||||
ansible.builtin.shell: |
|
||||
set -a
|
||||
. "{{ noble_repo_root }}/.env"
|
||||
set +a
|
||||
printf '%s' "${NOBLE_AUTHENTIK_SMTP_HOST:-}"
|
||||
register: noble_authentik_smtp_host_from_env
|
||||
when:
|
||||
- noble_authentik_dotenv_stat.stat.exists | default(false)
|
||||
- noble_authentik_smtp_host | default('') | length == 0
|
||||
changed_when: false
|
||||
no_log: true
|
||||
|
||||
- name: Apply NOBLE_AUTHENTIK_SMTP_HOST from .env
|
||||
ansible.builtin.set_fact:
|
||||
noble_authentik_smtp_host: "{{ noble_authentik_smtp_host_from_env.stdout | trim }}"
|
||||
when:
|
||||
- noble_authentik_smtp_host_from_env is defined
|
||||
- (noble_authentik_smtp_host_from_env.stdout | default('') | trim | length) > 0
|
||||
no_log: true
|
||||
|
||||
- name: Load NOBLE_AUTHENTIK_SMTP_FROM from .env when unset
|
||||
ansible.builtin.shell: |
|
||||
set -a
|
||||
. "{{ noble_repo_root }}/.env"
|
||||
set +a
|
||||
printf '%s' "${NOBLE_AUTHENTIK_SMTP_FROM:-}"
|
||||
register: noble_authentik_smtp_from_from_env
|
||||
when:
|
||||
- noble_authentik_dotenv_stat.stat.exists | default(false)
|
||||
- noble_authentik_smtp_from | default('') | length == 0
|
||||
changed_when: false
|
||||
no_log: true
|
||||
|
||||
- name: Apply NOBLE_AUTHENTIK_SMTP_FROM from .env
|
||||
ansible.builtin.set_fact:
|
||||
noble_authentik_smtp_from: "{{ noble_authentik_smtp_from_from_env.stdout | trim }}"
|
||||
when:
|
||||
- noble_authentik_smtp_from_from_env is defined
|
||||
- (noble_authentik_smtp_from_from_env.stdout | default('') | trim | length) > 0
|
||||
no_log: true
|
||||
|
||||
- name: Load NOBLE_AUTHENTIK_SMTP_USERNAME from .env when unset
|
||||
ansible.builtin.shell: |
|
||||
set -a
|
||||
. "{{ noble_repo_root }}/.env"
|
||||
set +a
|
||||
printf '%s' "${NOBLE_AUTHENTIK_SMTP_USERNAME:-}"
|
||||
register: noble_authentik_smtp_username_from_env
|
||||
when:
|
||||
- noble_authentik_dotenv_stat.stat.exists | default(false)
|
||||
- noble_authentik_smtp_username | default('') | length == 0
|
||||
changed_when: false
|
||||
no_log: true
|
||||
|
||||
- name: Apply NOBLE_AUTHENTIK_SMTP_USERNAME from .env
|
||||
ansible.builtin.set_fact:
|
||||
noble_authentik_smtp_username: "{{ noble_authentik_smtp_username_from_env.stdout | trim }}"
|
||||
when:
|
||||
- noble_authentik_smtp_username_from_env is defined
|
||||
- (noble_authentik_smtp_username_from_env.stdout | default('') | trim | length) > 0
|
||||
no_log: true
|
||||
|
||||
- name: Load NOBLE_AUTHENTIK_SMTP_PASSWORD from .env when unset
|
||||
ansible.builtin.shell: |
|
||||
set -a
|
||||
. "{{ noble_repo_root }}/.env"
|
||||
set +a
|
||||
printf '%s' "${NOBLE_AUTHENTIK_SMTP_PASSWORD:-}"
|
||||
register: noble_authentik_smtp_password_from_env
|
||||
when:
|
||||
- noble_authentik_dotenv_stat.stat.exists | default(false)
|
||||
- noble_authentik_smtp_password | default('') | length == 0
|
||||
changed_when: false
|
||||
no_log: true
|
||||
|
||||
- name: Apply NOBLE_AUTHENTIK_SMTP_PASSWORD from .env
|
||||
ansible.builtin.set_fact:
|
||||
noble_authentik_smtp_password: "{{ noble_authentik_smtp_password_from_env.stdout | trim }}"
|
||||
when:
|
||||
- noble_authentik_smtp_password_from_env is defined
|
||||
- (noble_authentik_smtp_password_from_env.stdout | default('') | trim | length) > 0
|
||||
no_log: true
|
||||
|
||||
- name: Load NOBLE_AUTHENTIK_SMTP_PORT from .env
|
||||
ansible.builtin.shell: |
|
||||
set -a
|
||||
. "{{ noble_repo_root }}/.env"
|
||||
set +a
|
||||
printf '%s' "${NOBLE_AUTHENTIK_SMTP_PORT:-}"
|
||||
register: noble_authentik_smtp_port_from_env
|
||||
when:
|
||||
- noble_authentik_dotenv_stat.stat.exists | default(false)
|
||||
changed_when: false
|
||||
no_log: true
|
||||
|
||||
- name: Apply NOBLE_AUTHENTIK_SMTP_PORT from .env
|
||||
ansible.builtin.set_fact:
|
||||
noble_authentik_smtp_port: "{{ noble_authentik_smtp_port_from_env.stdout | trim }}"
|
||||
when:
|
||||
- noble_authentik_smtp_port_from_env is defined
|
||||
- (noble_authentik_smtp_port_from_env.stdout | default('') | trim | length) > 0
|
||||
no_log: true
|
||||
|
||||
- name: Load NOBLE_AUTHENTIK_SMTP_USE_TLS from .env
|
||||
ansible.builtin.shell: |
|
||||
set -a
|
||||
. "{{ noble_repo_root }}/.env"
|
||||
set +a
|
||||
printf '%s' "${NOBLE_AUTHENTIK_SMTP_USE_TLS:-}"
|
||||
register: noble_authentik_smtp_use_tls_from_env
|
||||
when:
|
||||
- noble_authentik_dotenv_stat.stat.exists | default(false)
|
||||
changed_when: false
|
||||
no_log: true
|
||||
|
||||
- name: Apply NOBLE_AUTHENTIK_SMTP_USE_TLS from .env
|
||||
ansible.builtin.set_fact:
|
||||
noble_authentik_smtp_use_tls: "{{ noble_authentik_smtp_use_tls_from_env.stdout | trim }}"
|
||||
when:
|
||||
- noble_authentik_smtp_use_tls_from_env is defined
|
||||
- (noble_authentik_smtp_use_tls_from_env.stdout | default('') | trim | length) > 0
|
||||
no_log: true
|
||||
|
||||
- name: Load NOBLE_AUTHENTIK_SMTP_USE_SSL from .env
|
||||
ansible.builtin.shell: |
|
||||
set -a
|
||||
. "{{ noble_repo_root }}/.env"
|
||||
set +a
|
||||
printf '%s' "${NOBLE_AUTHENTIK_SMTP_USE_SSL:-}"
|
||||
register: noble_authentik_smtp_use_ssl_from_env
|
||||
when:
|
||||
- noble_authentik_dotenv_stat.stat.exists | default(false)
|
||||
changed_when: false
|
||||
no_log: true
|
||||
|
||||
- name: Apply NOBLE_AUTHENTIK_SMTP_USE_SSL from .env
|
||||
ansible.builtin.set_fact:
|
||||
noble_authentik_smtp_use_ssl: "{{ noble_authentik_smtp_use_ssl_from_env.stdout | trim }}"
|
||||
when:
|
||||
- noble_authentik_smtp_use_ssl_from_env is defined
|
||||
- (noble_authentik_smtp_use_ssl_from_env.stdout | default('') | trim | length) > 0
|
||||
no_log: true
|
||||
|
||||
- name: Load NOBLE_AUTHENTIK_SMTP_TIMEOUT from .env
|
||||
ansible.builtin.shell: |
|
||||
set -a
|
||||
. "{{ noble_repo_root }}/.env"
|
||||
set +a
|
||||
printf '%s' "${NOBLE_AUTHENTIK_SMTP_TIMEOUT:-}"
|
||||
register: noble_authentik_smtp_timeout_from_env
|
||||
when:
|
||||
- noble_authentik_dotenv_stat.stat.exists | default(false)
|
||||
changed_when: false
|
||||
no_log: true
|
||||
|
||||
- name: Apply NOBLE_AUTHENTIK_SMTP_TIMEOUT from .env
|
||||
ansible.builtin.set_fact:
|
||||
noble_authentik_smtp_timeout: "{{ noble_authentik_smtp_timeout_from_env.stdout | trim }}"
|
||||
when:
|
||||
- noble_authentik_smtp_timeout_from_env is defined
|
||||
- (noble_authentik_smtp_timeout_from_env.stdout | default('') | trim | length) > 0
|
||||
no_log: true
|
||||
|
||||
Reference in New Issue
Block a user