ansible-base/roles/authelia/tasks/main.json

161 lines
3.4 KiB
JSON
Raw Normal View History

2023-12-10 14:33:45 +01:00
[
{
2025-10-07 16:22:00 +02:00
"name": "show vars",
2025-10-07 16:55:26 +02:00
"when": "switch_show_vars",
2025-10-07 16:22:00 +02:00
"ansible.builtin.debug": {
"var": "vars.cfg_authelia"
2023-12-11 02:43:58 +01:00
}
},
{
2025-10-07 16:22:00 +02:00
"name": "packages",
"block": [
{
"name": "prerequisites",
"become": true,
"ansible.builtin.apt": {
"update_cache": true,
"pkg": [
"apt-transport-https",
"ca-certificates",
"gpg"
]
}
},
{
"name": "keys",
"become": true,
"ansible.builtin.get_url": {
"url": "https://www.authelia.com/keys/authelia-security.gpg",
"dest": "/usr/share/keyrings/authelia-security.gpg"
}
},
{
"name": "repository",
"become": true,
"ansible.builtin.shell": {
"cmd": "echo \"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/authelia-security.gpg] https://apt.authelia.com stable main\" > /etc/apt/sources.list.d/authelia.list",
"creates": "/etc/apt/sources.list.d/authelia.list"
}
2023-12-11 02:43:58 +01:00
2025-10-07 16:22:00 +02:00
},
{
"name": "installation",
"become": true,
"ansible.builtin.apt": {
"update_cache": true,
"pkg": [
"openssl",
"python3-cryptography",
"python3-yaml",
"authelia"
]
}
}
]
2023-12-10 14:33:45 +01:00
},
2023-12-15 15:24:51 +01:00
{
2023-12-16 11:33:38 +01:00
"name": "generate private key for signing OIDC JWTs",
"become": true,
"community.crypto.openssl_privatekey": {
"type": "RSA",
"size": 4096,
"path": "/etc/ssl/private/authelia-key.pem",
"return_content": true
},
"register": "temp_tls_result"
2023-12-15 15:24:51 +01:00
},
{
2025-10-07 16:22:00 +02:00
"name": "configuration",
"block": [
{
2025-10-07 18:27:51 +02:00
"name": "configuration | compose script",
2025-10-07 16:22:00 +02:00
"become": true,
"ansible.builtin.copy": {
"src": "conf-compose.py",
"dest": "/usr/bin/authelia-conf-compose",
"mode": "0700"
}
},
{
2025-10-07 18:27:51 +02:00
"name": "configuration | directories",
2025-10-07 16:22:00 +02:00
"become": true,
"loop": [
"/etc/authelia/conf.d",
"/etc/authelia/conf.d/clients"
],
"ansible.builtin.file": {
"state": "directory",
"path": "{{item}}"
}
},
{
2025-10-07 18:27:51 +02:00
"name": "configuration | main",
2025-10-07 16:22:00 +02:00
"become": true,
"ansible.builtin.template": {
"src": "conf-main.json.j2",
"dest": "/etc/authelia/conf.d/main.json"
}
},
{
2025-10-07 18:27:51 +02:00
"name": "configuration | compose",
2025-10-07 16:22:00 +02:00
"become": true,
"ansible.builtin.command": {
"cmd": "/usr/bin/authelia-conf-compose --main-file-path=/etc/authelia/conf.d/main.json --clients-directory-path=/etc/authelia/conf.d/clients --output-format=yaml --output-path=/etc/authelia/configuration.yml"
}
}
]
2023-12-16 15:13:41 +01:00
},
2023-12-11 02:43:58 +01:00
{
"name": "setup log directory",
"become": true,
"ansible.builtin.file": {
"state": "directory",
2025-10-07 18:27:51 +02:00
"owner": "authelia",
"group": "authelia",
2025-10-07 16:30:10 +02:00
"path": "{{cfg_authelia.log_file_path | dirname}}"
2023-12-11 02:43:58 +01:00
}
},
{
2025-10-07 16:22:00 +02:00
"name": "users",
"block": [
{
"name": "directory",
"become": true,
"ansible.builtin.file": {
"state": "directory",
2025-10-07 18:27:51 +02:00
"owner": "authelia",
"group": "authelia",
2025-10-07 16:30:10 +02:00
"path": "{{cfg_authelia.users_file_path | dirname}}"
2025-10-07 16:22:00 +02:00
}
},
{
"name": "initial file",
"become": true,
"ansible.builtin.template": {
"src": "users.yml.j2",
2025-10-07 16:30:10 +02:00
"dest": "{{cfg_authelia.users_file_path}}",
2025-10-07 16:22:00 +02:00
"force": false
}
},
{
"name": "management script",
"become": true,
"ansible.builtin.copy": {
"src": "user-manage.py",
"dest": "/usr/bin/authelia-user-manage",
"mode": "0700"
}
}
]
},
2023-12-10 14:33:45 +01:00
{
"name": "apply",
"become": true,
"ansible.builtin.systemd_service": {
"state": "restarted",
2024-03-21 08:03:59 +01:00
"enabled": true,
2023-12-10 14:33:45 +01:00
"name": "authelia"
2023-12-11 02:43:58 +01:00
}
2023-12-10 14:33:45 +01:00
}
]