|
| 1 | +Role Name |
| 2 | +========= |
| 3 | + |
| 4 | +Multi-user management with focus on a project to which everybody has access via sudo. |
| 5 | + |
| 6 | +Example case: |
| 7 | +- There are multiple organizations managing their pages |
| 8 | +- We deploy a docker project that contains multiple websites |
| 9 | +- Each user can manage the docker project via `sudo ./make.sh ... something ...` instead of having access to global sudo |
| 10 | + |
| 11 | + |
| 12 | +Role Variables |
| 13 | +-------------- |
| 14 | + |
| 15 | +```yamlex |
| 16 | +technical_entrypoint: "/project/make.sh" |
| 17 | +enable_technical_entrypoint: true |
| 18 | +
|
| 19 | +technical_account: "tech.admin" |
| 20 | +technical_account_id: 1800 |
| 21 | +technical_group: "technical" |
| 22 | +technical_group_id: 1161 |
| 23 | +
|
| 24 | +users: |
| 25 | + accounts: |
| 26 | + - login: iwa.somebody |
| 27 | + section: "ZSP" # account description / organization name / etc. |
| 28 | + password: 'some-password-hash-generated-by-mkpasswd' |
| 29 | + global_sudo: no |
| 30 | + gid: 1161 |
| 31 | + uid: 2050 |
| 32 | + disabled: no |
| 33 | +``` |
| 34 | + |
| 35 | +Example Playbook |
| 36 | +---------------- |
| 37 | + |
| 38 | +```yamlex |
| 39 | + - hosts: servers |
| 40 | + roles: |
| 41 | + - { role: username.rolename, x: 42 } |
| 42 | + vars: |
| 43 | + # ... |
| 44 | +``` |
| 45 | + |
| 46 | +Adding a new user account |
| 47 | +------------------------- |
| 48 | + |
| 49 | +1. Use the tool `./mkpasswd.sh` to generate a password |
| 50 | +2. Create an entry in the users.accounts variable (there are examples already) |
| 51 | + - Paste the password into password section of your new account with single quotes |
| 52 | + - Please do not enable `global_sudo` option unless you really have a reason for that |
| 53 | + - Please fill in `section` field with the organization name |
| 54 | + - Please use only a-z, numbers and dot characters for the user name, else it may not work |
| 55 | +3. Run deployment |
| 56 | + |
| 57 | +Blocking access for the user account |
| 58 | +------------------------------------ |
| 59 | + |
| 60 | +1. Edit users.accounts variable |
| 61 | +2. For specified user account please set `disabled: yes` |
| 62 | + - NOTICE: Deleting whole user section from file will not have an effect, as the deployment will ignore that user and will not change it |
| 63 | + so the user account deletion is not possible, only blocking is possible |
| 64 | +3. Run deployment |
| 65 | + |
| 66 | +License |
| 67 | +------- |
| 68 | + |
| 69 | +MIT |
| 70 | + |
| 71 | +Author Information |
| 72 | +------------------ |
| 73 | + |
| 74 | +Krzysztof Wesołowski, anarchosyndicalist, backend-devops programmer, grassroot advocate |
| 75 | + |
| 76 | +Made especially for: |
| 77 | +https://iwa-ait.org |
| 78 | +https://zsp.net.pl |
0 commit comments