40 lines
880 B
YAML
40 lines
880 B
YAML
---
|
|
# Creates the user and setups the systemD service.
|
|
|
|
- name: Ensure group "scaphandre" exists
|
|
ansible.builtin.group:
|
|
name: scaphandre
|
|
state: present
|
|
|
|
- name: Create scaphandre user
|
|
ansible.builtin.user:
|
|
name: scaphandre
|
|
groups:
|
|
- scaphandre
|
|
append: true
|
|
create_home: true
|
|
home: "{{ scaphandre_home_dir }}"
|
|
|
|
- name: Setup systemD service
|
|
ansible.builtin.template:
|
|
src: scaphandre.service.j2
|
|
dest: /etc/systemd/system/scaphandre.service
|
|
owner: root
|
|
group: root
|
|
mode: "644"
|
|
|
|
- name: Ensure proper permissions
|
|
ansible.builtin.file:
|
|
path: "{{ scaphandre_home_dir }}"
|
|
state: directory
|
|
recurse: true
|
|
owner: scaphandre
|
|
group: scaphandre
|
|
mode: u+rwx,g-wx,o-rwx
|
|
|
|
- name: Ensure scaphandre is running
|
|
ansible.builtin.systemd_service:
|
|
state: restarted
|
|
daemon_reload: true
|
|
name: scaphandre
|