Merge branch 'patch-1' of https://github.com/mr-c/arvados into mr-c-patch-1
[arvados.git] / doc / user / topics / arvados-sync-groups.html.textile.liquid
1 ---
2 layout: default
3 navsection: admin
4 title: "Synchronizing external groups"
5 ...
6 {% comment %}
7 Copyright (C) The Arvados Authors. All rights reserved.
8
9 SPDX-License-Identifier: CC-BY-SA-3.0
10 {% endcomment %}
11
12 The @arvados-sync-groups@ tool allows to synchronize groups in Arvados from an external source.
13
14 h1. Using arvados-sync-groups
15
16 This tool reads a CSV (comma-separated values) file having information about external groups and their members. When running it for the first time, it'll create a special group named 'Externally synchronized groups' meant to be the parent of all the remote groups.
17
18 Every line on the file should have 3 values: a group name, a local user identifier and a permission level, meaning that the named user is a member of the group with the provided permission. The tool will create the group if it doesn't exist, and add the user to it. If any group member is not present on the input file, it will be removed from the group.
19
20 Users can be identified by their email address or username: the tool will check if every user exist on the system, and report back when not found. Groups on the other hand, are identified by their name.
21
22 Permission level can be one of the following: @can_read@, @can_write@ or @can_manage@, giving the group member read, read/write or managing privileges on the group. For backwards compatibility purposes, if any record omits the third (permission) field, it will default to @can_write@ permission. You can read more about permissions on the "group management admin guide":/admin/group-management.html.
23
24 This tool is designed to be run periodically reading a file created by a remote auth system (ie: LDAP) dump script, applying what's included on the file as the source of truth.
25
26
27 bq. NOTE: @arvados-sync-groups@ needs to perform several administrative tasks on Arvados, so must be run using a superuser token
28
29 h2. Options
30
31 The following command line options are supported:
32
33 table(table table-bordered table-condensed).
34 |_. Option |_. Description |
35 |==--help==|             This list of options|
36 |==--parent-group-uuid==|   UUID of group to own all the externally synchronized groups|
37 |==--user-id== |            Identifier to use in looking up user. One of 'email' or 'username' (Default: 'email')|
38 |==--verbose==|             Log informational messages (Default: False)|
39 |==--version==|             Print version and exit|
40
41 h2. Examples
42
43 To sync groups using the username to identify every account, reading from some @external_groups.csv@ file, the command should be called as follows:
44
45 <notextile>
46 <pre><code>~$ <span class="userinput">arvados-sync-groups --user-id username /path/to/external_groups.csv </span>
47 </code></pre>
48 </notextile>
49
50 If you want to use a specific preexisting group as the parent of all the remote groups, you can do it this way:
51
52 <notextile>
53 <pre><code>~$ <span class="userinput">arvados-sync-groups --parent-group-uuid &lt;preexisting group UUID&gt; --user-id username /path/to/external_groups.csv </span>
54 </code></pre>
55 </notextile>