Tasks: add quick commands for authelia
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
/galaxy.roles/
|
/galaxy.roles/
|
||||||
/ansible-vault-password-file
|
/ansible-vault-password-file
|
||||||
|
/temp
|
||||||
*.retry
|
*.retry
|
||||||
|
|
||||||
test_smtp.py
|
test_smtp.py
|
||||||
|
29
Taskfile.yml
29
Taskfile.yml
@ -12,6 +12,7 @@ vars:
|
|||||||
sh: 'yq .ungrouped.hosts.server.ansible_user {{.HOSTS_FILE}}'
|
sh: 'yq .ungrouped.hosts.server.ansible_user {{.HOSTS_FILE}}'
|
||||||
REMOTE_HOST:
|
REMOTE_HOST:
|
||||||
sh: 'yq .ungrouped.hosts.server.ansible_host {{.HOSTS_FILE}}'
|
sh: 'yq .ungrouped.hosts.server.ansible_host {{.HOSTS_FILE}}'
|
||||||
|
AUTHELIA_DOCKER: 'docker run --rm -v $PWD:/data authelia/authelia:4.39.4 authelia'
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
install-roles:
|
install-roles:
|
||||||
@ -36,7 +37,33 @@ tasks:
|
|||||||
|
|
||||||
authelia-cli:
|
authelia-cli:
|
||||||
cmds:
|
cmds:
|
||||||
- docker run --rm authelia/authelia:latest authelia {{.CLI_ARGS}}
|
- "{{.AUTHELIA_DOCKER}} {{.CLI_ARGS}}"
|
||||||
|
|
||||||
|
authelia-validate-config:
|
||||||
|
vars:
|
||||||
|
DEST_FILE: "temp/configuration.yml"
|
||||||
|
cmds:
|
||||||
|
- >
|
||||||
|
ansible localhost
|
||||||
|
--module-name template
|
||||||
|
--args "src=files/authelia/configuration.yml.j2 dest={{.DEST_FILE}}"
|
||||||
|
--extra-vars "@vars/secrets.yml"
|
||||||
|
- >
|
||||||
|
{{.AUTHELIA_DOCKER}}
|
||||||
|
validate-config --config /data/{{.DEST_FILE}}
|
||||||
|
- rm -f {{.DEST_FILE}}
|
||||||
|
|
||||||
|
authelia-gen-random-string:
|
||||||
|
cmds:
|
||||||
|
- >
|
||||||
|
{{.AUTHELIA_DOCKER}}
|
||||||
|
crypto rand --length 64 --charset alphanumeric
|
||||||
|
|
||||||
|
authelia-gen-secret-and-hash:
|
||||||
|
cmds:
|
||||||
|
- >
|
||||||
|
{{.AUTHELIA_DOCKER}}
|
||||||
|
crypto hash generate pbkdf2 --variant sha512 --random --random.length 72 --random.charset rfc3986
|
||||||
|
|
||||||
format-py-files:
|
format-py-files:
|
||||||
cmds:
|
cmds:
|
||||||
|
Reference in New Issue
Block a user