add dooris role for setup of dooris interaction on the node itself
Some checks failed
/ build (pull_request) Successful in 28s
/ Ansible Lint (push) Failing after 2m47s
/ Ansible Lint (pull_request) Failing after 2m50s

This commit is contained in:
lilly 2026-07-19 16:59:38 +02:00
commit 2be6c1e943
Signed by: lilly
SSH key fingerprint: SHA256:y9T5GFw2A20WVklhetIxG1+kcg/Ce0shnQmbu1LQ37g
9 changed files with 81 additions and 5 deletions

View file

@ -0,0 +1,5 @@
- name: "reload sshd"
become: true
ansible.builtin.systemd_service:
name: "ssh.service"
state: "reloaded"

View file

@ -0,0 +1,14 @@
argument_specs:
main:
options:
dooris_static_api_token:
description: "A static token that is valid on the servers API and can operate locks"
required: true
type: str
dooris_url:
description: "The URL on which the dooris server is reachable"
required: true
type: str

View file

@ -0,0 +1,2 @@
dependencies:
- docker_compose

View file

@ -0,0 +1,35 @@
- name: Create local dooris group
become: true
ansible.builtin.group:
name: "dooris"
gid: 10000
- name: Create local dooris user
become: true
ansible.builtin.user:
name: "dooris"
uid: 10000
group: "dooris"
system: true
password: "!"
home: "/ansible_docker_compose/state/"
shell: "/ansible_docker_compose/state/ssh-cli"
- name: Ensure dooris state directory exists and has correct permissions
become: true
ansible.builtin.file:
path: "/ansible_docker_compose/state/"
owner: "dooris"
group: "dooris"
mode: "u=rwx,g=rx,o="
- name: Create ssh server config for dooris user
become: true
notify: "reload sshd"
ansible.builtin.template:
src: sshd_config
dest: /etc/ssh/sshd_config.d/dooris.conf
owner: root
group: root
mode: u=rw,g=r,o=r

View file

@ -0,0 +1,9 @@
# {{ ansible_managed }}
Match User dooris
AuthorizedKeysFile /ansible_docker_compose/state/dooris_authorized_keys
ForceCommand /ansible_docker_compose/state/ssh-cli
SetEnv DOORIS_SERVER_URL={{ dooris_url }} DOORIS_API_TOKEN={{ dooris_static_api_token }}