libreschool-epoptes/root/etc/ansible/roles/epoptes/tasks/epoptes-server.yml

53 lines
1.4 KiB
YAML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
- name: Install epoptes server
apt:
name: [ 'epoptes' ]
state: present
- name: Copy epoptes certificate key
copy:
src: "/var/lib/nethserver/secrets/epoptes/{{ epoptesgroup }}/server.key"
dest: "/etc/epoptes/server.key"
owner: root
group: root
mode: 0600
notify: restart epoptes
# TODO: all users and all groups
- name: Make sure the admin users are part of the epoptes group ({{ epoptesgroup }})
user:
name: "{{ user }}"
groups: epoptes
append: yes
state: present
loop: "{{ epoptesadminusers }}"
loop_control:
loop_var: user
# TODO: at the moment, this is unsupported.
# In Active Directory, groups can be part of other groups
# We can't reproduce that in linux, so we have to:
# - iterate the epoptesadmingroups list
# - for each group, fetch the members from nethserver-accounts
# - add each member
# We also have to deal with the removal of a user from the aforementioned groups
# - name: Make sure the users members of the admin groups are part of the epoptes group
# user:
# name: "{{ item.1 }}"
# groups: epoptes
# append: yes
# state: present
# with_subelements:
# - "{{ epoptesadmingroups }}"
# - members
- name: Set epoptes server as configured
set_fact: epoptes_server_configured=true