Git initial commit
This commit is contained in:
commit
0c4c78946e
9
LICENSE
Executable file
9
LICENSE
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) <year> <copyright holders>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
3
README.md
Executable file
3
README.md
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
# cloud-authentik
|
||||||
|
|
||||||
|
Ansible Role in order to setup go-authentik as a personal identity provider.
|
||||||
41
defaults/main.yml
Executable file
41
defaults/main.yml
Executable file
@ -0,0 +1,41 @@
|
|||||||
|
---
|
||||||
|
cloud_apps: /opt
|
||||||
|
cloud_storage: /opt/storage
|
||||||
|
cloud_stage: prod
|
||||||
|
cloud_update: false
|
||||||
|
domain_external: "my-domain.tld"
|
||||||
|
|
||||||
|
|
||||||
|
authentik_dir: "{{ cloud_apps }}/authentik"
|
||||||
|
|
||||||
|
authentik_version: 2023.8
|
||||||
|
authentik_source: https://goauthentik.io/version
|
||||||
|
authentik_target: docker-compose.yml
|
||||||
|
|
||||||
|
authentik_db:
|
||||||
|
type: pgsql
|
||||||
|
name: authentik_db
|
||||||
|
user: authentik_dbu
|
||||||
|
pass: authentik_dbpw
|
||||||
|
port: 5432
|
||||||
|
host: localhost
|
||||||
|
|
||||||
|
authentik_http_port: 9080
|
||||||
|
authentik_https_port: 9443
|
||||||
|
|
||||||
|
authentik_secret_key: MyVerySecretKey!
|
||||||
|
authentik_loglevel: info
|
||||||
|
|
||||||
|
authentik_admin_pass: VeryNicePassword!
|
||||||
|
authentik_admin_token:
|
||||||
|
|
||||||
|
authentik_stmp_host: "mail.{{ domain_external }}"
|
||||||
|
authentik_stmp_port: 25
|
||||||
|
authentik_smtp_user: "admin@{{ domain_external }}"
|
||||||
|
authentik_smtp_pass: VeryNicePassword!
|
||||||
|
authentik_smtp_from: "{{ authentik_smtp_user }}"
|
||||||
|
|
||||||
|
|
||||||
|
authentik_footer:
|
||||||
|
# - name: Link Name
|
||||||
|
# href: https://goauthentik.io
|
||||||
7
handlers/main.yml
Executable file
7
handlers/main.yml
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
- name: restart authentik
|
||||||
|
docker_compose:
|
||||||
|
project_src: "{{ authentik_inst }}"
|
||||||
|
state: present
|
||||||
|
restarted: yes
|
||||||
|
remove_orphans: yes
|
||||||
17
meta/main.yml
Executable file
17
meta/main.yml
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
galaxy_info:
|
||||||
|
role_name: authentik
|
||||||
|
namespace: hahn-cloud
|
||||||
|
author: Lars Hahn
|
||||||
|
company: OpenDevChain
|
||||||
|
license: MIT
|
||||||
|
description: Role to setup authentik Identity provider
|
||||||
|
min_ansible_version: 2.7
|
||||||
|
platforms:
|
||||||
|
- name: Debian
|
||||||
|
versions:
|
||||||
|
- 11
|
||||||
|
galaxy_tags:
|
||||||
|
- authentik
|
||||||
|
dependencies:
|
||||||
|
- docker
|
||||||
26
tasks/main.yml
Executable file
26
tasks/main.yml
Executable file
@ -0,0 +1,26 @@
|
|||||||
|
---
|
||||||
|
- name: setup authentik docker dir
|
||||||
|
file:
|
||||||
|
state: directory
|
||||||
|
path: "{{ item }}"
|
||||||
|
loop:
|
||||||
|
- "{{ authentik_dir }}"
|
||||||
|
- "{{ authentik_inst }}"
|
||||||
|
|
||||||
|
- name: download authentik compose file
|
||||||
|
get_url:
|
||||||
|
url: "{{ authentik_source }}/{{ authentik_version }}/{{ authentik_target }}"
|
||||||
|
dest: "{{ authentik_inst }}/{{ authentik_target }}"
|
||||||
|
force: yes
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
notify: restart authentik
|
||||||
|
|
||||||
|
- name: template environment
|
||||||
|
template:
|
||||||
|
src: opt/authentik/.env.j2
|
||||||
|
dest: "{{ authentik_inst }}/.env"
|
||||||
|
mode: 0640
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
notify: restart authentik
|
||||||
67
templates/opt/authentik/.env.j2
Executable file
67
templates/opt/authentik/.env.j2
Executable file
@ -0,0 +1,67 @@
|
|||||||
|
### BASIC ###
|
||||||
|
AUTHENTIK_PORT_HTTP={{ authentik_http_port | default(9080) }}
|
||||||
|
AUTHENTIK_PORT_HTTPS={{ authentik_https_port | default(9443) }}
|
||||||
|
|
||||||
|
AUTHENTIK_SECRET_KEY={{ authentik_secret_key }}
|
||||||
|
AUTHENTIK_LOG_LEVEL={{ authentik_loglevel }}
|
||||||
|
AUTHENTIK_OUTPOSTS__DISCOVER={{ authentik_autodiscover | default('true') }}
|
||||||
|
|
||||||
|
AUTHENTIK_DEFAULT_USER_CHANGE_NAME={{ authentik_user_change_name | default('true') }}
|
||||||
|
AUTHENTIK_DEFAULT_USER_CHANGE_MAIL={{ authentik_user_change_mail | default('true') }}
|
||||||
|
AUTHENTIK_DEFAULT_USER_CHANGE_USERNAME={{ authentik_user_change_username | default('true') }}
|
||||||
|
|
||||||
|
AUTHENTIK_GDPR_COMPLIANCE={{ authentik_gdpr_removeondelete | default('true') }}
|
||||||
|
AUTHENTIK_DISABLE_UPDATE_CHECK={{ authentik_check_update | default('false') }}
|
||||||
|
AUTHENTIK_ERROR_REPORTING__ENABLED={{ authentik_reporting_error | default('false') }}
|
||||||
|
AUTHENTIK_ERROR_REPORTING__SEND_PII={{ authentik_reporting_user | default('false') }}
|
||||||
|
AUTHENTIK_DISABLE_STARTUP_ANALYTICS={{ authentik_disable_analytics | default('true') }}
|
||||||
|
AUTHENTIK_AVATARS={{ authentik_avatars | default('none') }}
|
||||||
|
|
||||||
|
{% if authentik_footer is defined and authentik_footer is not none %}
|
||||||
|
AUTHENTIK_FOOTER_LINKS='{{ authentik_footer | to_json }}'
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if authentik_admin_pass is defined and authentik_admin_pass is not none %}
|
||||||
|
AK_ADMIN_PASS={{ authentik_admin_pass }}
|
||||||
|
{% endif %}
|
||||||
|
{% if authentik_admin_token and authentik_admin_token is not none %}
|
||||||
|
AK_ADMIN_TOKEN={{ authentik_admin_token }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### SMTP ###
|
||||||
|
# SMTP Host Emails are sent to
|
||||||
|
AUTHENTIK_EMAIL__HOST={{ authentik_stmp_host }}
|
||||||
|
AUTHENTIK_EMAIL__PORT={{ authentik_stmp_port }}
|
||||||
|
|
||||||
|
# Optionally authentikate (don't add quotation marks to you password)
|
||||||
|
AUTHENTIK_EMAIL__USERNAME={{ authentik_smtp_user }}
|
||||||
|
AUTHENTIK_EMAIL__PASSWORD={{ authentik_smtp_pass }}
|
||||||
|
# Email address authentik will send from, should have a correct @domain
|
||||||
|
AUTHENTIK_EMAIL__FROM={{ authentik_smtp_from }}
|
||||||
|
|
||||||
|
AUTHENTIK_EMAIL__TIMEOUT={{ authentik_smpt_timeout | default('10') }}
|
||||||
|
# Use StartTLS
|
||||||
|
AUTHENTIK_EMAIL__USE_TLS={{ authentik_smpt_usetls | default('false') }}
|
||||||
|
# Use SSL
|
||||||
|
AUTHENTIK_EMAIL__USE_SSL={{ authentik_smpt_usessl | default('false') }}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{% if authentik_db is not none %}
|
||||||
|
### POSTGRES ###
|
||||||
|
PG_PASS={{ authentik_db.pass }}
|
||||||
|
PG_USER={{ authentik_db.user }}
|
||||||
|
PG_DB={{ authentik_db.name }}
|
||||||
|
POSTGRES_PASSWORD={{ authentik_db.pass }}
|
||||||
|
POSTGRES_USER={{ authentik_db.user }}
|
||||||
|
POSTGRES_DB={{ authentik_db.name }}
|
||||||
|
AUTHENTIK_POSTGRESQL__HOST={{ authentik_db.host | default('localhost') }}
|
||||||
|
AUTHENTIK_POSTGRESQL__PORT={{ authentik_db.post | default(5432) }}
|
||||||
|
AUTHENTIK_POSTGRESQL__NAME={{ authentik_db.name }}
|
||||||
|
AUTHENTIK_POSTGRESQL__USER={{ authentik_db.user }}
|
||||||
|
AUTHENTIK_POSTGRESQL__PASSWORD={{ authentik_db.pass }}
|
||||||
|
{% endif %}
|
||||||
2
vars/main.yml
Executable file
2
vars/main.yml
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
authentik_inst: "{{ authentik_dir }}/inst"
|
||||||
Loading…
Reference in New Issue
Block a user