Compare commits

..

336 commits

Author SHA1 Message Date
Yohann D'ANELLO
2472ce5db0
Install curl and net-tools by default
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
2021-01-17 12:02:53 +01:00
Yohann D'ANELLO
50fa96f31a
Sort APT packages
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
2021-01-17 12:01:22 +01:00
Yohann D'ANELLO
21f19dc655
Add status.auro.re
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
2020-12-31 16:39:27 +01:00
Yohann D'ANELLO
20bdf23495
Register WikiJS
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
2020-12-24 01:46:16 +01:00
Yohann D'ANELLO
24fb0dbe69 Missing yml extension to reverse proxy config file 2020-12-15 17:00:15 +01:00
Yohann D'ANELLO
f27eee1c35 Add litl 2020-12-15 16:59:36 +01:00
Yohann D'ANELLO
33b96f2176 Add ghostream 2020-11-10 01:23:34 +01:00
Paul Ziolkowski
37e3fe2231 Add ldap replica rives 2020-11-09 18:53:47 +01:00
Paul Ziolkowski
d6590ea1a8 Add rives 2020-11-09 18:15:39 +01:00
Paul Ziolkowski
b232d6b40b Renommage re2o_service en re2o-service 2020-11-09 18:10:34 +01:00
Paul Ziolkowski
88ffd2297f Add residence les rives 2020-11-08 18:53:07 +01:00
chirac
8bf080dbf7 Fix radius permission bug 2020-11-08 18:50:38 +01:00
chirac
5b56f9cfc9 Revert "Use command instead of shell"
This reverts commit 0f9169284f.
2020-11-08 18:13:21 +01:00
Yohann D'ANELLO
c46a08858d Rename proxy -> proxy-ovh, proxy-local -> proxy 2020-11-06 01:09:25 +01:00
Yohann D'ANELLO
2cd029d6a5 Redirect HTTP requests that are directly made to the IP address to auro.re 2020-11-06 01:00:21 +01:00
Yohann D'ANELLO
7e48cbc3be Remove obsolete certbot configuration 2020-11-05 00:23:29 +01:00
ynerant
b92449a1f8 Merge branch 'fix-certbot' into 'master'
Fix Certbot, clean reverse proxy config

See merge request aurore/ansible!49
2020-11-05 00:04:34 +01:00
Yohann D'ANELLO
24ab53675a Automatically renew certificates if a new domain was added 2020-11-04 23:58:27 +01:00
Yohann D'ANELLO
b1f56938e6 Remove inexistant docker host 2020-11-04 23:51:10 +01:00
Yohann D'ANELLO
03d48a2d82 Add possibility to configure port forwarding, like SSH for Gitea 2020-11-04 23:49:35 +01:00
Yohann D'ANELLO
9de65d2574 Register missing services in reverse proxy config 2020-11-04 23:26:49 +01:00
Yohann D'ANELLO
ac7696c81f User cerbot-nginx to create certificates 2020-11-04 23:07:51 +01:00
Yohann D'ANELLO
f9b7e052b9 Store reverse proxy data in proxy host vars 2020-11-04 22:38:54 +01:00
ynerant
61f78f5bd3 Merge branch 'fix-ci' into 'master'
Fix CI

See merge request aurore/ansible!48
2020-11-04 20:54:55 +01:00
Yohann D'ANELLO
ae1510ccbb Add missing dependencies in the CI 2020-11-04 20:29:02 +01:00
Yohann D'ANELLO
0e0da24cb1 Prepare transition to Gitea, set up Drone CI 2020-11-04 20:17:37 +01:00
Yohann D'ANELLO
2eea740a66 Prepare transition to Gitea, set up Drone CI 2020-11-04 20:15:24 +01:00
Yohann D'ANELLO
1332a8f514 Use Alpine Linux to reduce test image size 2020-11-04 20:13:32 +01:00
Yohann D'ANELLO
26427665f3 Fix indentation 2020-11-04 20:11:31 +01:00
Yohann D'ANELLO
26a84ab001 A comma must be followed by at most one space 2020-11-04 20:10:47 +01:00
Yohann D'ANELLO
c11b3bc20f Comments must start by a space 2020-11-04 20:08:51 +01:00
Yohann D'ANELLO
3aa43cd198 Enlarge max line length, some URLs didn't fit 2020-11-04 20:06:45 +01:00
Yohann D'ANELLO
9505e87113 Use true instead of yes 2020-11-04 20:00:35 +01:00
Yohann D'ANELLO
0f9169284f Use command instead of shell 2020-11-04 19:49:49 +01:00
Yohann D'ANELLO
4c8e05e08f Use underscore instead of dashes 2020-11-04 19:36:40 +01:00
Yohann D'ANELLO
9b8dee098e Always set file permissions 2020-11-04 19:31:50 +01:00
Yohann D'ANELLO
d60b75109a Upgrade python, ansiblelint and yamllint 2020-11-04 18:50:10 +01:00
Yohann D'ANELLO
0daaf14f62 dns masters ipv4 is a list (warning: RP is broken) 2020-11-04 17:02:27 +01:00
Yohann D'ANELLO
b87fe7d063 Deploy docker for Gitea and Drone 2020-11-04 03:16:37 +01:00
Yohann D'ANELLO
3c405db661 Add Drone 2020-11-04 00:29:31 +01:00
Yohann D'ANELLO
2a6c005190 Replace ansible_header by ansible_managed 2020-11-03 23:29:30 +01:00
chirac
518560b392 Add new ldap replica at ovh 2020-11-03 14:21:26 +01:00
chirac
a213e18d9c Update Ldap priority 2020-11-02 17:25:38 +01:00
chirac
4a43c0f0db Update re2o ip 2020-11-02 17:25:26 +01:00
chirac
16477042e8 Remove ldap-replica-backup 2020-11-02 12:22:34 +01:00
Jeltz
3d64f22c39 Modification du keepalive d'OpenSSHd.
Les serveurs OpenSSH détectent désormais la déconnexion du client et
peuvent terminer la session.
2020-10-24 19:12:35 +02:00
chirac
68f7fd5b59 Isc-dhcp-server config for banni/accueil vlans 2020-10-17 19:48:34 +02:00
chirac
0d7bfbd872 Create group for non pve physical server 2020-10-17 19:48:17 +02:00
Yohaï-Eliel BERREBY
8adf6b8105 add ipv6-edge-router role 2020-09-28 18:15:03 +02:00
chirac
ba2baa3020 Return routes now handled by keepalived 2020-09-27 13:55:56 +02:00
Gabriel Detraz
bba144ef14 Inverse les opérations de lecture/ecriture par defaut -> rw
Ce fix corrige le problème des opérations d'écritures dans la bdd master remote,
qui marchaient mal, désormais les lignes de logs historiques sont correctement écrites.
Il semblerait que django avait du mal à savoir que ces opérations reversion sont bien des opérations
d'écriture.
2020-09-19 14:02:53 +02:00
chirac
773f39cede Fichier inutile 2020-09-16 21:04:10 +02:00
chirac
dac049f125 Tous les cron dhcp sont décalés de 2 minutes 2020-09-16 21:02:44 +02:00
chirac
57df3002a3 Fix proxy-backup -> proxy-local 2020-09-16 21:02:05 +02:00
chirac
b7978f4ec3 Add services-bdd-local 2020-09-15 19:37:59 +02:00
Yohaï-Eliel BERREBY
91157d80c1 dhcp: run re2o service as root in cron / directly 2020-09-13 17:54:46 +02:00
Yohaï-Eliel BERREBY
6dd6168d2a dhcp: upgrade role for dhcp-aurore-backup 2020-09-12 16:03:33 +02:00
Yohann D'ANELLO
c07bf24062 Add dhcp-aurore-backup 2020-09-12 14:50:13 +02:00
chirac
f05a6507f0 Add pendragon + re2o-* vm -> aurore_vm 2020-09-12 12:13:36 +02:00
Yohaï-Eliel BERREBY
9b07fc9001 dhcp: manage dhcp-aurore 2020-09-11 15:13:11 +02:00
chirac
26743b464d Add Radius-aurore.adm.auro.re to ansible managed radius servers 2020-09-09 23:17:15 +02:00
chirac
53842e4c2f Add ipv6 Radius AURORE address 2020-09-09 23:16:35 +02:00
Yohaï-Eliel BERREBY
e48425300a Merge branch 'ansible-2.10' into master 2020-09-08 22:35:30 +02:00
Yohaï-Eliel BERREBY
276a780c65 hosts: add viviane and nextcloud 2020-09-08 22:32:49 +02:00
Yohann D'ANELLO
5c46191389 Register camelot and gitea, make camelot accessible for everyone 2020-09-04 09:56:02 +02:00
Yohaï-Eliel BERREBY
646ebd3ba9 router: ansibilize routeur-aurore{,backup} 2020-08-08 20:45:38 +02:00
Yohaï-Eliel BERREBY
12b0bc91dc radvd: cosmetic changes 2020-08-08 11:32:34 +02:00
Yohaï-Eliel BERREBY
b199c45d97 fix broken radius role
Would crash if called from anything other than the nuke radius DBs
playbook
2020-08-08 11:32:06 +02:00
Yohaï-Eliel BERREBY
af3c3dc132 enable radvd service 2020-08-08 11:19:16 +02:00
Yohaï-Eliel BERREBY
d98764d88e Merge branch 'ipv6' into ansible-2.10 2020-08-06 09:58:43 +02:00
Yohaï-Eliel BERREBY
30e503458e add ability to nuke radius DBs 2020-08-06 09:57:54 +02:00
Yohaï-Eliel BERREBY
e762091435 explain fe80::1 keepalived/radvd magic 2020-08-02 12:15:27 +02:00
Yohaï-Eliel BERREBY
de36a3bb95 announce IPv6 recursive resolver (untested) 2020-08-02 12:15:15 +02:00
Yohaï-Eliel BERREBY
8360e212cc enable SSH pipelining (THE SPEED!) 2020-08-02 12:14:57 +02:00
Yohaï-Eliel BERREBY
3a8112bf0d roll out (private) IPv6 on George Sand 2020-08-01 17:48:39 +02:00
Yohaï-Eliel BERREBY
361fd54414 keepalived: add IPv6 virtual route 2020-08-01 16:07:27 +02:00
Yohaï-Eliel BERREBY
2e6306b61e radvd: advertise keepalived VIP 2020-08-01 16:05:41 +02:00
Yohaï-Eliel BERREBY
56808e4e60 wip: begin updating 'router' role for IPv6
pending: update virtual routes
2020-08-01 15:46:41 +02:00
Yohaï-Eliel BERREBY
194c19fbf3 fix wrong hardcoded email for keepalived monitoring 2020-08-01 15:34:49 +02:00
Yohaï-Eliel BERREBY
713c93ac44 update unbound role for IPv6 2020-08-01 14:32:02 +02:00
Yohaï-Eliel BERREBY
d54da8d2b9 add ipv6_base_prefix variable 2020-08-01 14:31:49 +02:00
Yohaï-Eliel BERREBY
468bb9abde add radvd comment 2020-08-01 14:22:30 +02:00
Yohaï-Eliel BERREBY
f09b0906c6 radvd: fix wifi interface, comment out APs for now 2020-08-01 14:20:08 +02:00
Yohaï-Eliel BERREBY
a4841e6947 add radvd role, deploy in routers 2020-08-01 12:56:23 +02:00
Yohaï-Eliel BERREBY
a32116131d raise MTU at fleming
already been deployed for a while, forgot to push
2020-08-01 12:02:37 +02:00
Alexandre Iooss
c7c6e50dd9 Remove matrix mxisd 2020-07-22 10:04:25 +02:00
fpoutre
8639887fd1 Merge branch 'ansible-2.10' of gitlab.federez.net:aurore/ansible into ansible-2.10 2020-07-06 22:28:03 +02:00
fpoutre
354a5e7d63 created a dedicated ldap_replica role 2020-07-06 22:27:53 +02:00
TinyLinux
511734a978 Add ldap-replica-gs-backup to hosts 2020-07-06 22:06:16 +02:00
fpoutre
f7617c4478 added ldap-replica-gs to hosts 2020-07-06 18:52:46 +02:00
Yohaï-Eliel BERREBY
337906c6c0 add gs dhcp, dns, routing
and add thor to inventory
2020-07-06 18:40:54 +02:00
Yohaï-Eliel BERREBY
a6b15c0e10 vars: use apartment block id for subnets 2020-05-21 20:06:47 +02:00
Yohaï-Eliel BERREBY
4866ce915c clean up README for ansible(devel) 2020-05-21 19:46:39 +02:00
Yohaï-Eliel BERREBY
63b4425a27 gs: fix vars 2020-05-21 19:45:35 +02:00
Yohaï-Eliel BERREBY
fe62055cdd radius: enable service, fix details 2020-05-21 19:25:30 +02:00
Yohaï-Eliel BERREBY
8ce63d14b6 radius: fix settings_local.py 2020-05-21 18:39:50 +02:00
Yohaï-Eliel BERREBY
99070ed5ef radius: step 2 of deployment (WIP) 2020-05-21 18:06:37 +02:00
Yohaï-Eliel BERREBY
e2fa1964af radius: change proxy.conf password, use vault
and also actually template it... it wasn't being
uploaded.
2020-05-21 14:19:28 +02:00
Yohaï-Eliel BERREBY
266b0dde6f radius: initial setup 2020-05-16 22:08:22 +02:00
Yohaï-Eliel BERREBY
8355546131 edc: raise DHCP-announced MTU to 1500 2020-05-14 17:50:06 +02:00
Yohaï-Eliel BERREBY
6d00e2733b unbound: fix log rotation
Was too frequent, now that we only log SERVFAILs.
Rotate according to file size.
Fix unbound-control binary path.
2020-05-11 20:18:23 +02:00
Yohaï-Eliel BERREBY
87b2e4f8cf pacaterie: raise MTU to 1500 2020-05-09 16:15:56 +02:00
Yohaï-Eliel BERREBY
ba3aec348f keepalived: deploy to fleming w/ proper password 2020-05-09 16:07:04 +02:00
Alexandre Iooss
a992612381
Add certbot challenge DNS-01 key 2020-05-09 13:03:31 +02:00
Alexandre Iooss
9c226c680c
Certbot wildcard role 2020-05-09 12:54:38 +02:00
Alexandre Iooss
544498c81a
New reverse proxy role 2020-05-09 12:52:17 +02:00
Alexandre Iooss
eae3a3ff44
Deploy docker-worker1-aurore and proxy-backup 2020-05-09 12:21:36 +02:00
Yohaï-Eliel BERREBY
dea4dda285 hosts: remove dhcp and recursive_dns groups
Use patterns instead for now.
2020-05-09 10:15:28 +02:00
Pierre
3f26e7d4b4 routeur de la pacaterie en ...254 au lieu de ...240 pour keepalived 2020-05-08 18:39:05 +02:00
Yohaï-Eliel BERREBY
a4d0f051b6 dhcp: restart server on config update 2020-05-08 16:44:32 +02:00
Yohaï-Eliel BERREBY
223578eefa keepalived: no ansible_managed
Used to restart keepalived needlessly
2020-05-08 16:43:49 +02:00
Yohaï-Eliel BERREBY
4372b21976 dhcp: allow different router IP suffix
This variable is only needed because we're in the process of deploying
keepalived. For now it's only at EDC.
2020-05-08 16:36:07 +02:00
Yohaï-Eliel BERREBY
e58ee1c4b5 keepalived: initial config 2020-05-08 16:25:02 +02:00
Yohaï-Eliel BERREBY
26524eccc5 ansible-list: allow lack of idempotence 2020-05-07 20:33:25 +02:00
Yohaï-Eliel BERREBY
e45bdcbba8 network.yml: ensure safety without --limit 2020-05-07 20:27:36 +02:00
Yohaï-Eliel BERREBY
fea73a13aa aurore-firewall: correct backup router ip 2020-05-07 20:23:30 +02:00
Yohaï-Eliel BERREBY
8ba2de1698 aurore-firewall: fix repo address + branch 2020-05-07 20:01:44 +02:00
Yohaï-Eliel BERREBY
44be43e528 aurore-firewall: add config after cloning 2020-05-07 19:57:00 +02:00
Yohaï-Eliel BERREBY
1a10729b67 hosts: manage dhcp-edc 2020-05-07 19:48:07 +02:00
Yohaï-Eliel BERREBY
5ee7bb3069 ansible.cfg: unset scp_if_ssh 2020-05-07 19:48:07 +02:00
Yohaï-Eliel BERREBY
c77ae7f4c3 aurore-firewall: initial setup
group_vars: add apartment_block_id var
dhcp: move vars to role
2020-05-07 19:47:50 +02:00
Yohaï-Eliel BERREBY
268c4d2419 hosts: manage recursive DNS on EDC 2020-05-07 18:51:45 +02:00
Yohaï-Eliel BERREBY
e4d428d1dc unbound: change task order
Seems to be necessary to restart unbound manually for some reason?...
2020-05-07 18:49:31 +02:00
Yohaï-Eliel BERREBY
3d742c391c hosts: add routeur-edc-backup 2020-05-07 17:06:48 +02:00
Yohaï-Eliel BERREBY
4f224ee817 re2o-service: install Python dependencies 2020-05-07 14:55:12 +02:00
Yohaï-Eliel BERREBY
24a6063a91 baseconfig: fix resolv.conf 2020-05-07 14:51:02 +02:00
Yohaï-Eliel BERREBY
3f5e0d0035 edc: add group vars required for dhcp deployment 2020-05-07 13:03:44 +02:00
Yohaï-Eliel BERREBY
0db7713bbf hosts: add dhcp-edc-backup 2020-05-07 12:55:19 +02:00
Yohaï-Eliel BERREBY
7c7abb6be5 baseconfig: set up /etc/resolv.conf 2020-05-07 12:53:59 +02:00
Yohaï-Eliel BERREBY
7e9c4352a0 base: group name is ldap_replica
It's an underscore, not a hyphen
2020-05-04 18:49:51 +02:00
Yohaï-Eliel BERREBY
9c1f186682 hosts: s/physical/pve/g, add new backup hosts 2020-05-04 18:48:00 +02:00
Alexandre Iooss
ef88d0a42b
Some clean up in hosts 2020-05-03 20:50:29 +02:00
Alexandre Iooss
36343d90fd
BangShebang! 2020-05-03 18:45:07 +02:00
Alexandre Iooss
dc2db3d6a3
Decomment hosts 2020-05-03 18:40:26 +02:00
Alexandre Iooss
3b72e2fe2d
Remove SSH blacklist 2020-05-03 17:26:10 +02:00
Alexandre IOOSS
e42bdd53a8 Merge branch 'aurore-dev' into 'master'
Aurore dev

See merge request aurore/ansible!47
2020-05-03 16:11:29 +02:00
Alexandre IOOSS
81592fa986 Merge branch 'master' into 'aurore-dev'
# Conflicts:
#   .gitignore
#   hosts
#   network.yml
#   proxmox.yml
2020-05-03 16:11:19 +02:00
Yohaï-Eliel BERREBY
29991141f5 misc: add script to copy SSH keys
This one has the advantage of actually working :)
I had to blacklist some hosts because they would either outright refuse
connections or would refuse my LDAP credentials.
2020-05-03 11:26:53 +02:00
Yohaï-Eliel BERREBY
a77b2c4f0f unbound: fix MTU settings
That was the root cause of all our DNSSEC issues.
Now that this was fixed, we're not having these anymore,
so the relaxed checks can be restored back to their original state.
2020-05-02 18:59:22 +02:00
Yohaï-Eliel BERREBY
aae7e0120a unbound: drop verbosity but log SERVFAILs
TODO: less frequent log rotation because of decreased log volume
2020-05-02 18:06:58 +02:00
Yohaï-Eliel BERREBY
c54e8f5d67 unbound: smarter logging
- stop using journald, write to /var/log/unbound/
- set up frequent log rotation for the huge log files
we are producing
2020-05-02 17:13:01 +02:00
Yohaï-Eliel BERREBY
1dca5d2259 unbound: use handlers
Only restart unbound if the configuration
was actually updated.
2020-05-02 16:43:44 +02:00
Yohaï-Eliel BERREBY
b94c62d710 unbound-control: no certificates for local use 2020-05-02 16:37:21 +02:00
Yohaï-Eliel BERREBY
3695a3d771 unbound: attempt to fix spurious blacklisting 2020-04-28 23:14:43 +02:00
Yohaï-Eliel BERREBY
b4482b6d3b unbound: configure unbound-control 2020-04-28 20:21:47 +02:00
Yohaï-Eliel BERREBY
bac131791b unbound: bump verbosity up to 3
Some users are having issues resolving *.auro.re domains from our
network, and the bug does not show itself reliably. Increased verbosity
should help us pinpoint its source.
2020-04-28 20:13:56 +02:00
Yohaï-Eliel BERREBY
ded5f38aec unbound: name set_fact tasks 2020-04-18 17:36:25 +02:00
yberreby
7234d90fae Merge branch 'dns' into 'aurore-dev'
Finalisation du déploiement d'unbound

See merge request aurore/ansible!46
2020-04-18 17:10:22 +02:00
Yohaï-Eliel BERREBY
662452065f dhcp: remove Cloudflare from backup DNS
and rename variable, since these are not technically
upstream DNS servers
(unbound will ask the root servers, not these)
2020-04-18 17:06:38 +02:00
Yohaï-Eliel BERREBY
12022389c4 hosts: enable dhcp deployment on fleming 2020-04-18 16:57:18 +02:00
Yohaï-Eliel BERREBY
a0651d7703 unbound: bind to the right addresses on backup hosts 2020-04-18 16:56:34 +02:00
Yohaï-Eliel BERREBY
b57fa6e356 dhcp: use backup DNS servers too 2020-04-18 16:56:34 +02:00
Yohaï-Eliel BERREBY
22166bc69b unbound: log to journalctl 2020-04-18 16:56:17 +02:00
Yohaï-Eliel BERREBY
bfc7d542df hosts: add all DNS VMs from fleming and pacaterie 2020-04-18 15:43:39 +02:00
Yohaï-Eliel BERREBY
1777d0e154 unbound: log to /var/log/unbound.log, errors only 2020-04-18 15:42:31 +02:00
Yohaï-Eliel BERREBY
7275ebda47 dhcp: ask clients to use our DNS servers 2020-04-18 15:39:32 +02:00
chirac
59b9059116 Merge branch 'dns' into 'aurore-dev'
Déploiement basique de serveur DNS récursif

See merge request aurore/ansible!45
2020-04-13 19:08:32 +02:00
Yohaï-Eliel BERREBY
f05e92dc5e unbound: remove unchecked configuration keys 2020-04-13 18:42:02 +02:00
Yohaï-Eliel BERREBY
b3712ed335 unbound: initial deployment 2020-04-13 18:41:12 +02:00
Yohaï-Eliel BERREBY
9b043d95d3 dhcp: don't touch pacaterie yet 2020-04-06 19:06:53 +02:00
Yohaï-Eliel BERREBY
8fee0857c1 re2o-service: force clone git repository 2020-04-06 19:03:38 +02:00
Yohaï-Eliel BERREBY
8579b99b2e dhcp: cron.d entry + let main.py restart the server 2020-04-06 19:03:10 +02:00
Yohaï-Eliel BERREBY
6cce62850d dhcp: configure log rotation 2020-04-06 17:58:14 +02:00
Yohaï-Eliel BERREBY
7347829494 tackle logs 2020-04-06 17:48:56 +02:00
Yohaï-Eliel BERREBY
51fdb89940 extract dhcp-failover.conf into separate file 2020-04-06 17:28:04 +02:00
Yohaï-Eliel BERREBY
d323b78c16 fix bogus dhcpd config
- move failover peer declaration to beginning of file
- set split only on primary
- fix re2o-service hostname
- add /etc/default/isc-dhcp-server
2020-04-06 17:22:50 +02:00
Yohaï-Eliel BERREBY
e760f9ad91 re2o-service: fix hostname 2020-04-06 16:53:59 +02:00
Yohaï-Eliel BERREBY
89a0dc57ab run corresponding re2o-service on DHCP servers 2020-04-06 16:49:14 +02:00
Yohaï-Eliel BERREBY
01439c2388 fix network.yml syntax 2020-04-06 16:37:10 +02:00
F/Poutre
7ed34f79bd Update network.yml 2020-04-06 16:31:32 +02:00
F/Poutre
fc21a5fa3d Update base.yml 2020-04-06 16:30:52 +02:00
Yohaï-Eliel BERREBY
34b448faec dhcp: implement failover peer configuration 2020-04-06 14:41:34 +02:00
Yohaï-Eliel BERREBY
2a0a2e2ac6 dhcp: fix silly mix-ups 2020-04-06 13:20:52 +02:00
Yohaï-Eliel BERREBY
6b369d5b28 fix ProxyJump in README 2020-04-05 19:51:03 +02:00
Yohaï-Eliel BERREBY
709e4614c2 suppression d'une déclaration DNS redondante 2020-04-05 19:04:03 +02:00
Yohaï-Eliel BERREBY
e6b2f80b49 templatisation de la config dhcpd
non encore testé
2020-04-05 18:44:37 +02:00
fpoutre
40e915a7e0 happy little mistakes 2020-03-22 19:06:38 +01:00
fpoutre
0e61fcff90 added support for ldap-replicas in the base.yml for edc and gs 2020-03-22 18:43:57 +01:00
fpoutre
23f1b7a4a1 added support for edc and gs in ldap replica backup configuration 2020-03-22 18:42:00 +01:00
fpoutre
b7b32dc496 modified the master_ldap_uri to use a ndd 2020-02-20 19:08:09 +01:00
fpoutre
c0692c9ea8 added ldap-replica support for ldap-clients of pacaterie and fleming 2020-02-20 18:42:57 +01:00
fpoutre
3a399bd04c added ldap-replica support for ldap-clients of pacaterie and fleming 2020-02-20 18:42:34 +01:00
fpoutre
73a22ba77f added group ldap-replica to hosts 2020-02-20 16:51:56 +01:00
fpoutre
08fcf49e62 modified mainly hosts to match new servers and vms 2020-02-20 16:23:10 +01:00
fpoutre
d9f2d06c44 added aurore's hosts 2020-02-15 21:33:57 +01:00
Alexandre Iooss
a44c7064d2
Add more logic 2019-12-05 14:08:08 +01:00
Alexandre Iooss
5061a029e0
Do not ask why, it was not there 2019-12-05 14:07:48 +01:00
Alexandre Iooss
b60ca7111a
Mini useful script 2019-12-05 14:07:13 +01:00
Alexandre Iooss
639fbbcd28
test séminaire 2019-12-02 20:33:29 +01:00
Alexandre Iooss
07e71659ef
Monitor Unifi AP 2019-11-01 19:02:21 +01:00
Alexandre Iooss
ccbd7d3770
Failover VMs 2019-11-01 15:38:35 +01:00
Alexandre Iooss
6dec3ed0d1
Proxmox playbook and unifi ap 2019-11-01 15:17:59 +01:00
Alexandre Iooss
5b3ac2a21a
Merge crans version 2019-11-01 14:16:32 +01:00
fpoutre
203815c429 modified hosts and network playbook 2019-09-01 21:53:51 +02:00
fpoutre
a03c775dbd ajout des vm de DS et d'EdC, ajout de qqes hôtes 2019-09-01 13:27:58 +02:00
Alexandre Iooss
6c1d904791
Vault in passbolt 2019-09-01 11:18:23 +02:00
Alexandre Iooss
e91d47ea8d
Update matrix conf 2019-08-29 07:04:37 +02:00
Alexandre Iooss
6cc0a6a6b7
Remove appservice Discord 2019-08-29 07:03:54 +02:00
Alexandre Iooss
743e902e85
Refractor ldap 2019-08-29 07:03:05 +02:00
Alexandre Iooss
e15ea7854a
Base config sync with crans 2019-08-29 07:02:15 +02:00
Alexandre Iooss
281a2dcadf
Add fleming network infra 2019-07-27 21:31:33 +02:00
Alexandre Iooss
2be40222fc
Add fleming conf 2019-07-26 22:47:10 +02:00
Alexandre Iooss
044e8af3aa
Move EtherPad to Docker 2019-07-26 08:50:07 +02:00
Alexandre Iooss
b488007578
[docker] Install docker-compose 2019-07-25 19:10:50 +02:00
Alexandre Iooss
5ee1172861
Fix monitoring 2019-07-25 11:28:17 +02:00
Alexandre Iooss
e0b69be43a
Add privatebin to proxy 2019-07-25 11:05:21 +02:00
Alexandre Iooss
24331ca25b
Fix CI 2019-07-22 21:04:58 +02:00
Alexandre Iooss
2e753db873
Indicate unifi role 2019-07-22 21:00:13 +02:00
Alexandre Iooss
7161d59157
Update inventory to Ansible 2.8 2019-07-22 20:57:44 +02:00
Alexandre Iooss
a2e9ab7d3f
Merge crans Ansible conf 2019-07-22 20:57:32 +02:00
Alexandre Iooss
7f07556cfa
Merge LDAP into base playbook 2019-07-22 20:57:16 +02:00
Alexandre Iooss
694501dfa3
Merge crans monitoring 2019-07-22 20:56:43 +02:00
Alexandre Iooss
e86cb23660
network playbook 2019-07-22 19:17:54 +02:00
Alexandre Iooss
4a3851acc8
Clean up playbooks 2019-07-22 19:17:38 +02:00
Alexandre Iooss
a45ca1a890
Move CodiMD to Docker 2019-07-22 19:14:43 +02:00
Alexandre Iooss
9a35650166
Move Riot web to docker 2019-07-22 10:32:34 +02:00
Alexandre Iooss
66d870ce36
Add docker role 2019-07-22 10:32:01 +02:00
Alexandre Iooss
9018c69da3
Fix matrix v1 2019-07-22 09:12:55 +02:00
Alexandre Iooss
1ed6228728
Simplify help message on server login 2019-05-26 13:03:09 +02:00
Alexandre IOOSS
cda40556a2 Merge branch 'passbolt' into 'master'
Passbolt

See merge request aurore/ansible!44
2019-05-26 12:56:52 +02:00
Alexandre Iooss
2e0679a973
[passbolt] Add some dep 2019-05-26 12:52:41 +02:00
Alexandre Iooss
a986ecd36a
Passbolt playbook 2019-05-23 07:28:44 +02:00
Alexandre Iooss
81b24357ca
Add passbolt and vpn-ovh 2019-05-23 07:00:27 +02:00
Alexandre Iooss
72a60a988b
Unifi playbook 2019-05-07 18:52:07 +02:00
Alexandre Iooss
3a6a891aad
Add unifi-pacaterie 2019-05-07 18:51:22 +02:00
Alexandre Iooss
b6573e68ae
Exclude Stretch from node config 2019-05-05 16:24:04 +02:00
Alexandre Iooss
c53d62712f
Make prometheus node exporter listen only on adm 2019-05-05 16:17:52 +02:00
Alexandre Iooss
95f24b69af
Monitor all pacaterie 2019-05-05 14:26:38 +02:00
Alexandre Iooss
c1c995e38d
Prometheus role 2019-05-05 14:07:04 +02:00
Alexandre IOOSS
091bf9a0d8 Merge branch 'dhcp' into 'master'
DHCP service

See merge request aurore/ansible!43
2019-05-05 13:17:59 +02:00
Alexandre Iooss
681c79b2f5
DNS playbook 2019-05-04 18:56:27 +02:00
Alexandre Iooss
d5a7ce8bb4
Add a radius at pacaterie 2019-05-04 18:44:54 +02:00
Alexandre Iooss
8dc40ecb1e
Specify git branch 2019-05-04 18:43:20 +02:00
Alexandre Iooss
61e99ed0b1
Change serviceuser passwd 2019-05-04 12:08:48 +02:00
Alexandre Iooss
8b7d4207b8
Autogenerate service config 2019-05-04 11:46:54 +02:00
Alexandre Iooss
5939d434fd
Beginning of isc-dhcp-server config 2019-05-04 10:54:51 +02:00
Alexandre Iooss
41eb131e69
Fix true values being yes 2019-05-03 22:50:48 +02:00
Alexandre Iooss
81ca7a177d
Initial DHCP re2o service 2019-05-03 22:42:55 +02:00
Alexandre Iooss
aab2daf5b7
Fix Riot depo key 2019-05-03 22:42:12 +02:00
Alexandre Iooss
5e738f40a7
Uniformize motd 2019-05-03 15:52:50 +02:00
Alexandre Iooss
1bcd9741f9
Python 3 by default 2019-05-03 14:46:58 +02:00
Alexandre Iooss
32744ca6b6
Add new pacaterie vms 2019-05-03 14:46:24 +02:00
Alexandre IOOSS
1cc6bc744b Merge branch 'change_default_soft' into 'master'
Add screen and remove iPython2

See merge request aurore/ansible!20
2019-05-03 14:38:49 +02:00
Alexandre IOOSS
94c5b7c1df Merge branch 'autoproxmox' into 'master'
Create VM with Proxmox API

See merge request aurore/ansible!42
2019-05-03 13:13:43 +02:00
Alexandre Iooss
d761c51c6f
Fix identation 2019-05-03 13:11:39 +02:00
Alexandre Iooss
0c8763c702
Create VM with Proxmox API 2019-05-03 13:06:26 +02:00
Alexandre IOOSS
8b8de00dbb Merge branch 'parallelism' into 'master'
Parallelism

See merge request aurore/ansible!41
2019-04-07 17:03:21 +02:00
Alexandre IOOSS
1e7dce0d73 Merge branch 'move_pve' into 'master'
Move new PVE

See merge request aurore/ansible!40
2019-04-07 17:01:29 +02:00
Alexandre Iooss
110389ae7c
Parallelism 2019-04-07 17:00:29 +02:00
Alexandre Iooss
104cc3d09e
Move new PVE 2019-04-07 16:59:19 +02:00
Alexandre IOOSS
11173eef23 Merge branch 'no_handler_systemd' into 'master'
Remove useless systemd handler

See merge request aurore/ansible!39
2019-04-06 15:24:27 +02:00
Alexandre Iooss
55cf8b801d
Remove useless systemd handler 2019-04-06 15:19:52 +02:00
Alexandre IOOSS
df6c966b7f Merge branch 'matrix_appservices_conf' into 'master'
Matrix appservices conf

See merge request aurore/ansible!38
2019-04-01 18:58:41 +02:00
Alexandre Iooss
1b3a6f7bf8
Configure IRC Matrix appservice 2019-04-01 18:53:37 +02:00
Alexandre Iooss
84694900e4
Annonce the right Webhook URL for Matrix 2019-04-01 17:57:43 +02:00
Alexandre Iooss
2158c5c6b9
Pass Matrix Webhook through reverse proxy 2019-04-01 17:57:20 +02:00
Alexandre IOOSS
98c6364394 Merge branch 'generic_services' into 'master'
Generic services

See merge request aurore/ansible!37
2019-04-01 17:53:49 +02:00
Alexandre Iooss
88b9356f7d
Make CodiMD role more generic 2019-03-30 13:34:25 +01:00
Alexandre Iooss
48d521fb00
Use generic service model for matrix appservices 2019-03-30 13:26:20 +01:00
Alexandre IOOSS
e1a3dda771 Merge branch 'generic_matrix_appservice' into 'master'
Simplify Matrix appservices

See merge request aurore/ansible!36
2019-03-30 09:13:35 +01:00
Alexandre Iooss
5ccb94e621
Simplify Matrix appservices 2019-03-29 19:25:11 +01:00
Alexandre IOOSS
d9aab6cfd2 Merge branch 'various_fixes' into 'master'
Fix so everything is working fine today

See merge request aurore/ansible!35
2019-03-26 09:20:27 +01:00
Alexandre Iooss
d4d6baed1a
Fix so everything is working fine today 2019-03-26 09:17:46 +01:00
Alexandre IOOSS
00ccc4c377 Merge branch 'refactor' into 'master'
Refactor

See merge request aurore/ansible!30
2019-03-26 08:36:21 +01:00
Alexandre IOOSS
24429ca7b4 Merge branch 'riot_config' into 'master'
Default configuration for Riot

See merge request aurore/ansible!34
2019-03-26 08:34:18 +01:00
Alexandre Iooss
ee4f144b4a
Default configuration for Riot 2019-03-26 08:30:02 +01:00
Alexandre IOOSS
9731832797 Merge branch 'fix_vfat_pve' into 'master'
Fix PVE unable to mount vfat at boot

See merge request aurore/ansible!33
2019-03-25 10:58:40 +01:00
Alexandre Iooss
7950191a53
Fix PVE unable to mount vfat at boot 2019-03-25 10:55:51 +01:00
Alexandre IOOSS
077db64576 Merge branch 'update_discord_appservice' into 'master'
Switch discord appservice to develop

See merge request aurore/ansible!32
2019-03-24 17:08:13 +01:00
Alexandre Iooss
11e084a104
Switch discord appservice to develop 2019-03-24 17:05:24 +01:00
Alexandre IOOSS
40e63ba89e Merge branch 'discord_matrix' into 'master'
Discord matrix

See merge request aurore/ansible!31
2019-03-24 12:44:23 +01:00
Alexandre Iooss
bbc04d971f
Working appservice Discord 2019-03-24 12:10:35 +01:00
Hadrien Patte
66f7b1061a
Feat: migrate from with_X to loop
Signed-off-by: Hadrien Patte <hadrien.patte@protonmail.com>
2019-03-23 20:11:27 +01:00
Hadrien Patte
c20d4fbf18
Feat: expand YAML syntax
Signed-off-by: Hadrien Patte <hadrien.patte@protonmail.com>
2019-03-23 20:05:45 +01:00
Hadrien Patte
8a48110c21
Feat: add validate for sudoers
Signed-off-by: Hadrien Patte <hadrien.patte@protonmail.com>
2019-03-23 20:05:45 +01:00
Hadrien Patte
737ca7b996
Feat: add state
Signed-off-by: Hadrien Patte <hadrien.patte@protonmail.com>
2019-03-23 20:05:42 +01:00
Hadrien Patte
e4a60341c5
Feat: simplify one item lists
Signed-off-by: Hadrien Patte <hadrien.patte@protonmail.com>
2019-03-23 20:04:35 +01:00
Hadrien Patte
5551fb5c16
Fix: remove unnecessary quotes
Signed-off-by: Hadrien Patte <hadrien.patte@protonmail.com>
2019-03-23 20:04:33 +01:00
Hadrien Patte
8463f1cf96
Feat: use ini_file module
Signed-off-by: Hadrien Patte <hadrien.patte@protonmail.com>
2019-03-23 19:21:59 +01:00
Alexandre IOOSS
8da9e10a51 Merge branch 'sudo_location' into 'master'
sudo group by location

See merge request aurore/ansible!29
2019-03-23 13:52:51 +01:00
Alexandre Iooss
489bb5ddcf
sudo group by location 2019-03-23 13:49:53 +01:00
Alexandre IOOSS
a8d8e312e0 Merge branch 'whitelist_fail2ban' into 'master'
Whitelist proxy

See merge request aurore/ansible!28
2019-03-23 13:04:24 +01:00
Alexandre Iooss
01ad50ef95
Whitelist proxy 2019-03-23 13:00:18 +01:00
Alexandre Iooss
bd229fb11e
Update matrix-appservice-discord config 2019-03-23 12:52:39 +01:00
Alexandre IOOSS
b889cec431 Merge branch 'setup-pacat' into 'master'
Add Pacaterie to inventory

See merge request aurore/ansible!27
2019-03-18 18:53:34 +01:00
Alexandre Iooss
9c5f021fd6 Add Pacaterie to inventory 2019-03-18 18:49:35 +01:00
Alexandre IOOSS
cd00daaad9 Merge branch 'fix_matrix_webhooks' into 'master'
Changed URL to make the Webhooks appservice work

See merge request aurore/ansible!26
2019-03-17 10:45:47 +01:00
Alexandre Iooss
3198a50c93
Changed URL to make the Webhooks appservice work 2019-03-17 10:42:43 +01:00
Alexandre IOOSS
2b79f9117e Merge branch 'debsums_security' into 'master'
Configure SSH and add debsums

See merge request aurore/ansible!25
2019-03-16 22:09:40 +01:00
Alexandre Iooss
724db5f8c8 Configure SSH and add debsums 2019-03-16 22:06:50 +01:00
Alexandre IOOSS
b370cc364a Merge branch 'fix_http' into 'master'
Hotfix HTTP

See merge request aurore/ansible!24
2019-03-16 21:12:41 +01:00
Alexandre Iooss
a3b7cf6270 Hotfix HTTP 2019-03-16 21:10:00 +01:00
Alexandre IOOSS
c38c1aedc1 Merge branch 'secure_ssh' into 'master'
Fail2ban by default

See merge request aurore/ansible!23
2019-03-14 15:49:12 +01:00
Alexandre Iooss
221be36085 Fail2ban by default 2019-03-14 15:45:19 +01:00
Alexandre IOOSS
258bf1f90c Merge branch 'nginx_security' into 'master'
Add proxy snippets and use nginx-light

See merge request aurore/ansible!22
2019-03-14 12:28:05 +01:00
Alexandre Iooss
fb11981e8a Follow Mozilla guidelines 2019-03-14 12:25:27 +01:00
Alexandre Iooss
af07bb7c0a Better SSL conf 2019-03-14 11:53:55 +01:00
Alexandre Iooss
a8fa5d69ff Add proxy snippets and use nginx-light 2019-03-14 10:53:44 +01:00
Alexandre IOOSS
f9473d0769 Merge branch 'matrix-appservice-webhooks' into 'master'
Matrix appservice webhooks

See merge request aurore/ansible!21
2019-03-12 20:04:18 +01:00
Alexandre Iooss
0cc36a107c Fix CI 2019-03-12 19:58:55 +01:00
Alexandre Iooss
c9761e53dd Connect to Synapse 2019-03-12 18:33:32 +01:00
Alexandre Iooss
1a447b3807 Add matrix-appservice-webhooks and move nodejs tasks 2019-03-12 18:03:23 +01:00
Alexandre IOOSS
fa7aa8ea75 Merge branch 'master' into 'change_default_soft'
# Conflicts:
#   roles/baseconfig/tasks/main.yml
2019-03-12 17:27:23 +01:00
Alexandre IOOSS
f7476481c2 Merge branch 'ansible-lint' into 'master'
Add ansible-lint to the CI pipeline

See merge request aurore/ansible!15
2019-03-12 17:25:44 +01:00
Alexandre Iooss
bc1459bc51 Fix various yamllint warnings 2019-03-12 17:22:42 +01:00
Alexandre Iooss
5dfd8eacc5 Replace 'yes' by 'true' 2019-03-12 17:04:06 +01:00
Alexandre Iooss
431b063db7 Maybe last fix for the CI 2019-03-12 16:56:01 +01:00
Alexandre Iooss
cc48990798 Use NPM module in matrix-appservice-discord 2019-03-12 16:51:27 +01:00
Alexandre Iooss
4a6da11837 Clean up EtherPad dep install 2019-03-12 16:34:35 +01:00
Alexandre Iooss
a8656251ab Tab is useless in sudoers 2019-03-12 07:48:09 +01:00
Alexandre Iooss
dd19efaecd Do not download rest_auth_provider.py 2019-03-12 07:47:07 +01:00
Alexandre Iooss
16ca4956dc Make EtherPad default text shorter 2019-03-11 18:15:17 +01:00
Alexandre Iooss
4b5631e60b Retry 3 times npm and yarn 2019-03-11 18:12:55 +01:00
Alexandre Iooss
b9d5601e36 Remove useless PRODUCTION var for webpack CodiMD 2019-03-11 18:10:35 +01:00
Alexandre Iooss
84263d7712 Do not use depreciated loop with APT 2019-03-11 18:02:29 +01:00
Alexandre Iooss
53b67acb07 Fix a error due to previous merge 2019-03-11 17:53:12 +01:00
Alexandre Iooss
b56ae30335 Use YARN module from Ansible 2.7 2019-03-11 17:49:48 +01:00
Alexandre Iooss
af81b41e83 Use NPM module for matrix-appservice-irc 2019-03-11 17:44:42 +01:00
Alexandre Iooss
4ebaa4f36f Add retries to APT modules in Matrix Appservices 2019-03-11 15:39:11 +01:00
Alexandre Iooss
1274ec4be4 Fix last line of CodiMD apt dep 2019-03-11 15:30:49 +01:00
Alexandre Iooss
f347daa408 Use systemd module rather than command 2019-03-11 15:12:58 +01:00
Alexandre Iooss
563d9658ed Add newline at end of 0_apt_dependencies.yml in CodiMD role 2019-03-11 15:10:17 +01:00
Alexandre IOOSS
1a4e41d318 Merge branch 'master' into 'ansible-lint'
# Conflicts:
#   roles/codimd/tasks/0_apt_dependencies.yml
2019-03-11 15:00:11 +01:00
Alexandre Iooss
ce40a5cb66 Add screen and remove iPython2 2019-03-11 14:55:21 +01:00
Alexandre IOOSS
4dfdc74bd8 Merge branch 'basesecurity' into 'master'
Security policies based on ANSSI recommandations

See merge request aurore/ansible!19
2019-03-11 14:52:56 +01:00
Alexandre Iooss
a08be12b41 Security policies based on ANSSI recommandations 2019-03-11 14:52:03 +01:00
Alexandre IOOSS
d5d7d6fde5 Merge branch 'add_matrix_services' into 'master'
Add matrix services

See merge request aurore/ansible!16
2019-03-11 14:26:10 +01:00
Alexandre IOOSS
2391ddcd2d Merge branch 'vulcain_ansible' into 'master'
Ajout des machines setup à la pacaterie

See merge request aurore/ansible!18
2019-03-11 14:24:25 +01:00
Vulcain
761695f992 ajout des machines setup à la pacaterie 2019-03-10 18:46:37 +01:00
Alexandre Iooss
0b887c2abb Add matrix-appservice-irc 2019-03-10 11:50:07 +01:00
Alexandre Iooss
d6627f5cce Add matrix-appservice-discord 2019-03-10 11:10:59 +01:00
Alexandre Iooss
7302c83f60 Add new container 2019-03-09 10:18:10 +01:00
Hadrien Patte
b55a2ee047
Fix: add a retry statement to remote package tasks
Signed-off-by: Hadrien Patte <hadrien.patte@protonmail.com>
2019-03-03 19:55:51 +01:00
Hadrien Patte
4555ca782b
Feat: update ansible-lint to version 4.0.0
Signed-off-by: Hadrien Patte <hadrien.patte@protonmail.com>
2019-03-03 19:55:32 +01:00
Hadrien Patte
5c5195cc2c
Fix: use systemd instead of command module
Signed-off-by: Hadrien Patte <hadrien.patte@protonmail.com>
2019-03-03 19:32:42 +01:00
Hadrien Patte
b49bd3620b
Feat: add ansible-lint to the CI pipeline
Signed-off-by: Hadrien Patte <hadrien.patte@protonmail.com>
2019-03-03 19:06:33 +01:00
181 changed files with 6731 additions and 1089 deletions

2
.ansible-lint Normal file
View file

@ -0,0 +1,2 @@
skip_list:
- '301'

19
.drone.yml Normal file
View file

@ -0,0 +1,19 @@
---
kind: pipeline
type: docker
name: check
steps:
- name: yamllint
image: python:3.9-alpine
commands:
- pip install yamllint==1.25.0
- yamllint -c .yamllint.yml .
- name: ansible-lint
image: python:3.9-alpine
commands:
- apk add --no-cache gcc libc-dev libffi-dev openssl-dev
- pip install ansible-lint==4.3.7
- ansible-lint *.yml
...

2
.gitignore vendored
View file

@ -1 +1,3 @@
*.retry
tmp
ldap-password.txt

View file

@ -1,6 +1,19 @@
---
image: quay.io/ansible/molecule:2.19
image: python:3.9-alpine
stages:
- lint
yamllint:
script: yamllint -c .yamllint.yml .
stage: lint
script:
- pip install yamllint==1.25.0
- yamllint -c .yamllint.yml .
ansible-lint:
stage: lint
script:
- apk add gcc libc-dev libffi-dev openssl-dev
- pip install ansible-lint==4.3.7
- ansible-lint *.yml
...

View file

@ -3,5 +3,6 @@ extends: default
rules:
line-length:
max: 120
level: warning
...

153
README.md
View file

@ -1,49 +1,140 @@
# Playbook et rôles Ansible d'Aurore
# Recettes Ansible d'Aurore
## Exécution d'un playbook
Ensemble des recettes de déploiement Ansible pour les serveurs d'Aurore.
Pour les utiliser, vérifiez que vous avez au moins Ansible 2.7.
Pour appliquer le playbook `base.yml` :
```bash
ansible-playbook --ask-vault-pass base.yml
```
## Ansible 101
Il est souhaitable de faire un test avant avec `--check` si on a des doutes !
Si vous n'avez jamais touché à Ansible avant, voilà une rapide introduction.
## FAQ
**Inventory** : c'est le fichier `hosts` d'inventaire.
Il contient la définition de chaque machine et le regroupement.
### Mettre sa clé SSH sur une machine
Quand on regroupe avec un `:children` en réalité on groupe des groupes.
```
ssh-copy-id -i ~/.ssh/id_rsa_aurore.pub virtu.fede-aurore.net
```
Chaque machine est annoncée avec son hostname. Il faut pouvoir SSH sur cette machine
avec ce hostname, car c'est ce qu'Ansible fera.
### Automatiquement ajouter fingerprint ECDSA (dangereux !)
**Playbook** : c'est une politique de déploiement.
Il contient les associations des rôles avec les machines.
Il faut changer la variable d'environnement suivante :
`ANSIBLE_HOST_KEY_CHECKING=0`.
L'idée au Crans est de regrouper par thème. Exemple, le playbook `monitoring.yml`
va contenir toutes les définitions machines-rôles qui touchent au monitoring.
Cela permet de déployer manuellement tout le monitoring sans toucher au reste.
### Configurer la connexion au bastion
**Rôle** : un playbook donne des rôles à des machines. Ces rôles sont tous dans
le dossier `roles/`. Un rôle installe un service précis sur un serveur.
Envoyer son agent SSH peut être dangereux ([source](https://heipei.io/2015/02/26/SSH-Agent-Forwarding-considered-harmful/)).
Il est préférable d'être atomique sur les rôles plutôt d'en coder un énorme
qui sera difficilement maintenable.
On va utiliser plutôt ProxyJump.
Dans la configuration SSH :
*Exemples de rôle* : activer les backports pour ma version de Debian, installer NodeJS,
déployer un serveur prometheus, déployer une node prometheus…
```
# Use a key to log on all Aurore servers
# and use a bastion
Host 10.128.0.* *.adm.auro.re
IdentityFile ~/.ssh/id_rsa_aurore
ProxyJump proxy.auro.re
```
**Tâche** : un rôle est composé de tâches. Une tâche effectue une et une seule
action. Elle est associée à un module Ansible.
Il faut savoir que depuis Ansible 2.5, des connexions persistantes sont créées
vers les serveurs puis détruites à la fin de l'exécution.
Il faut donc éviter de lancer une connexion SSH persistante pendant l'exécution
d'Ansible.
*Exemples de tâche* : installer un paquet avec le module `apt`, ajouter une ligne dans
un fichier avec le module `lineinfile`, copier une template avec le module `template`
Une tâche peut avoir des paramètres supplémentaires pour la réessayer quand elle plante,
récupérer son résultat dans une varible, mettre une boucle dessus, mettre des conditions…
N'oubliez pas d'aller lire l'excellent documentation de RedHat sur tous les modules
d'Ansible !
### Gestion des groupes de machines
Pour la liste complète, je vous invite à lire le fichier `hosts`.
* pour tester les versions de Debian,
```YAML
ansible_lsb.codename == 'stretch'
```
* pour tester si c'est un CPU Intel x86_64,
```YAML
ansible_processor[0].find('Intel') != -1
and ansible_architecture == 'x86_64'
```
Pour les fonctions (`proxy-server`, `dhcp-dynamique`…) il a été choisi
de ne pas faire de groupe particulier mais plutôt de sélectionner/enlever
les machines pertinentes directement dans les playbooks.
### Lister tout ce que sait Ansible sur un hôte
Lors du lancement d'Ansible, il collecte un ensemble de faits sur les serveurs
qui peuvent ensuite être utilisés dans des variables.
Pour lister tous les faits qu'Ansible collecte nativement d'un serveur
on peut exécuter le module `setup` manuellement.
```
ansible -i hosts ldap-replica-fleming1.adm.auro.re -m setup --ask-vault-pass
ansible proxy.adm.auro.re -m setup --ask-vault-pass
```
## Exécution d'Ansible
### Configurer la connexion au vlan adm
Envoyer son agent SSH peut être dangereux
([source](https://heipei.io/2015/02/26/SSH-Agent-Forwarding-considered-harmful/)).
On va utiliser plutôt `ProxyJump`.
Dans la configuration SSH :
```
# Use a proxy jump server to log on all Aurore inventory
Host 10.128.0.* *.adm.auro.re
ProxyJump passerelle.auro.re
```
Il faut sa clé SSH configurée sur le serveur que l'on déploit.
```bash
ssh-copy-id proxy.adm.auro.re
```
### Lancer Ansible
Il faut `python3-netaddr` sur sa machine.
Pour tester le playbook `base.yml` :
```bash
ansible-playbook --ask-vault-pass base.yml --check
```
Vous pouvez ensuite enlever `--check` si vous voulez appliquer les changements !
Si vous avez des soucis de fingerprint ECDSA, vous pouvez ignorer une
première fois (dangereux !) : `ANSIBLE_HOST_KEY_CHECKING=0 ansible-playbook...`.
### Ajouter tous les empruntes de serveur
```bash
#!/bin/bash
for ip in `cat hosts|grep .adm.auro.re`; do
ssh-copy-id -i ~/.ssh/id_rsa.pub $ip
done
```
### Passage à Ansible 2.10 (release: 30 juillet)
Installez la version de développement d'ansible pour faire fonctionner les
playbooks de ce repo, ainsi que les collections suivantes :
```bash
ansible-galaxy collection install community.general
ansible-galaxy collection install ansible.posix
```
Si vous n'arrivez pas à entrer votre _become password_ (bug dans ansible?), un
workaround est le suivant :
`$ export ANSIBLE_BECOME_PASS='<votre mot de passe LDAP>'`
Notez l'espace au début pour ne pas log la commande dans votre historique
shell.

View file

@ -1,19 +1,25 @@
# Aurore Ansible configuration
# Ansible configuration
[defaults]
# Use Aurore inventory
# Do not create .retry files
retry_files_enabled = False
# Use inventory
inventory = ./hosts
# Custom header in templates
ansible_managed = Ansible managed: {file} modified on %Y-%m-%d %H:%M:%S by {uid} on {host}
# Do not create retry files
retry_files_enabled = False
ansible_managed = Ansible managed, modified on %Y-%m-%d %H:%M:%S by {uid}
# Do not use cows (with cowsay)
nocows = 1
# Do more parallelism
forks = 15
# Some SSH connection will take time
timeout = 60
[privilege_escalation]
# Use sudo to get priviledge access
@ -27,3 +33,6 @@ become_ask_pass = True
# TO know what changed
always = yes
[ssh_connection]
pipelining = True

11
base.yml Normal file → Executable file
View file

@ -1,5 +1,12 @@
#!/usr/bin/env ansible-playbook
---
# Put a common configuration on all servers
- hosts: all
- hosts: all,!unifi
roles:
- baseconfig
- baseconfig
- basesecurity
# Plug LDAP on all servers
- hosts: all,!unifi
roles:
- ldap_client

View file

@ -1,6 +0,0 @@
---
# Install CodiMD on CodiMD containers
- hosts: codimd.adm.auro.re
roles:
- debian-backports
- codimd

20
copy-keys.sh Executable file
View file

@ -0,0 +1,20 @@
#!/bin/bash
set -e
# Grab valid unique hostnames from the Ansible inventory.
HOSTS=$(grep -ve '^[#\[]' hosts \
| grep -F adm.auro.re \
| sort -u)
# Ask password
read -s -p "Hello adventurer, what is your LDAP password? " passwd
echo
for host in $HOSTS; do
echo "[+] Handling host $host"
# sshpass can be used for non-interactive password authentication.
# place your password in ldap-password.txt.
SSHPASS=${passwd} sshpass -v -e ssh-copy-id -i ~/.ssh/id_rsa "$host"
done

View file

@ -1,6 +0,0 @@
---
# Install DokuWiki on the wiki TEST container
# When it will be operational, horus-wikitest will replace horus-wiki
- hosts: horus-wikitest
roles:
- dokuwiki

View file

@ -1,6 +0,0 @@
---
# Install EtherPad on EtherPad containers
- hosts: pad.adm.auro.re
roles:
- debian-backports
- etherpad

View file

@ -1,20 +1,19 @@
---
# Use Python 3
ansible_python_interpreter: '/usr/bin/env python3'
ansible_python_interpreter: /usr/bin/python3
# LDAP binding
# You can hash LDAP passwords with `slappasswd` tool
ldap_base: 'dc=auro,dc=re'
ldap_master_ipv4: '10.128.0.11'
ldap_master_uri: "ldap://{{ ldap_master_ipv4 }}"
ldap_master_ipv4: '10.128.0.21'
ldap_master_uri: "ldap://re2o-ldap.adm.auro.re"
ldap_user_tree: "cn=Utilisateurs,{{ ldap_base }}"
ldap_nslcd_bind_dn: "cn=nslcd,ou=service-users,{{ ldap_base }}"
ldap_nslcd_passwd: "{{ vault_ldap_nslcd_passwd }}"
ldap_codimd_bind_dn: "cn=codimd,ou=service-users,{{ ldap_base }}"
ldap_codimd_password: "{{ vault_ldap_codimd_password }}"
ldap_matrix_bind_dn: "cn=matrix,ou=service-users,{{ ldap_base }}"
ldap_matrix_password: "{{ vault_ldap_matrix_password }}"
ldap_replica_password: "{{ vault_ldap_replica_password }}"
ldap_admin_password: "{{ vault_ldap_admin_password }}"
ldap_admin_hashed_passwd: "{{ vault_ldap_admin_hashed_passwd }}"
# Databases
@ -33,3 +32,60 @@ ssh_pub_keys: "{{ vault_ssh_pub_keys }}"
# Monitoring
monitoring_mail: 'monitoring.aurore@lists.crans.org'
# Matrix
matrix_webhooks_secret: "{{ vault_matrix_webhooks_secret }}"
matrix_discord_client_id: "559305991494303747"
matrix_discord_bot_token: "{{ vault_matrix_discord_bot_token }}"
###
# DNS
###
# Dernier octet (en décimal) de l'addresse des serveurs DNS récursifs de chaque
# résidence.
dns_host_suffix_main: 253
dns_host_suffix_backup: 153
backup_dns_servers:
- "80.67.169.12" # French Data Network (FDN) (ns0.fdn.fr)
# Finally raised!
mtu: 1500
subnet_ids:
ap: "14{{ apartment_block_id }}"
users_wired: "{{ apartment_block_id }}0"
users_wifi: "{{ apartment_block_id }}1"
users_banni: "{{ apartment_block_id }}2"
users_accueil: "{{ apartment_block_id }}3"
# Keepalived
keepalived_password: "{{ vault_keepalived_password[apartment_block] }}"
# Re2o config
re2o_secret_key: "{{ vault_re2o_secret_key }}"
re2o_db_password: "{{ vault_re2o_db_password }}"
re2o_aes_key: "{{ vault_re2o_aes_key }}"
# Radius
radius_secret_aurore: "{{ vault_radius_secrets.aurore }}"
radius_secret_wifi: "{{ vault_radius_secrets.wifi }}"
radius_secret_wired: "{{ vault_radius_secrets.wired[apartment_block] }}"
radius_secret_federez: "{{ vault_radius_secrets.federez }}"
radius_pg_replication_password: "{{ vault_re2o_db_user_passwords.replication }}"
radius_pg_re2o_ro_password: "{{ vault_re2o_db_user_passwords.re2o_ro }}"
# DHCP
dhcp_failover_enabled: true
apartment_block_dhcp: "{{ apartment_block }}"
# Careful, this is not byte-aligned, just nibble-aligned (RIPE gave us a /28).
# However, we ALWAYS keep the trailing 0 to have byte alignment.
ipv6_base_prefix: "2a09:6840"
is_aurore_host: "{{ 'aurore_vm' in group_names }}"

View file

@ -1,106 +1,174 @@
$ANSIBLE_VAULT;1.1;AES256
38616339383037366465353638383665643938633061323863386539323861633135363964303364
6335326537383039316566623031306136633364336337320a343434623066313535363430303866
61613635663336376530333463363037316230323339393463393465313366643438316565306564
3263613463653764330a363330623331323762306330336465633538353637373838396231643762
35353137306132653861343736323934326161663436653737333462333938393330393861363764
38333837353564396563623039636438663662626330323632383234333662613835633138326161
33626537633863393864373937306332386131626562323762616439643830626339633833313638
65363930353162323635356430313030303734386339393730383135323937623939393233663335
39316564396463643134636363326262343538666234333837373164646434643232623666636162
61616637396561323166313131393163353166353764396564373330326262346666373034663465
35326563306538653562333864383662336338656566313432633831313363663131393930336234
61336230643539303532656437616638323266623434393863623661366237386537386232383332
38643433626466343633626665386633663964306566643436363839363462326632393863616230
62386662386363613737613839386436383734623461386363313832636661636334633132363433
30383135646465353232623936366337663130376232343231376565313563303534313462336462
39353861663230623536613735663865373238303832306636323532393734303538383837336237
36613732623539616237663962666263393138303064646335623336343432323266663335363061
36306361653035653334343031303663373334613365393635616362343461616535343964306666
36663030373133346663663839373363663163653961323533356361373533643636626339356332
34663063326363646638646330626666633564373763326636363764653831336134393131653864
62353163613534386364323430346435316339363338666563366262336536373162346265353165
66363834306536383465376339323462303265373263333065623837656133623035366366396335
34313566326565333930386336353333396237633333613336666566393465616563393563633335
33313232646466313333633564653535343564626566353863613964303732616436626535656135
39313632346530636639333435643034666138633831313864316266376330336334333263356132
30613865336164353433383232316637663131653231393235343262666636623461653332323664
63323637396132666333633863393131363935626435313366646563366366356265346130373162
66306261303539323763336130616165323863646466643336316437663266303730313433343932
39643639376531303839636632333063323837306638373863663132386533353735343234666139
33633462346438356338613830313533306263383263383036363566323437356235386636333432
31383462626338346339353536653437623731643036363366666437316362356266396634383865
65663332383837373334393863386531663831643366613131663666303436306336313935643065
61336661313562326465393936643130393465346636363234386436616165613436393436623664
33396165376363316334613737613261396633306233643337393936393465313763343439646136
38643135346234653234316536363964303331303932656134323165333239623362333931323334
62323634373764663464343031626432653131306664336130396265363964663866663538376239
33653430366265623733376536613632646662646632653132336537383336303335623966396131
62303136613934656664386162373433323962336134663435373730366632666135663030653133
38613632623765616465383266356238313333336434376238396339343031323465343833323665
61666366326363303832663164363838353739653534313235336530396330346466656432386636
36613239613239613835633265363064316134346464616338333532376132373637356665346230
38343461613335663061393037643466383664323263336364356364363262346236326161653362
63653963303139616430333738373038333661333562376130363061366338346430303231363138
66373866303331333035316533373336376466346630326166373734353834306237383462356430
33633332366636613534313933323065633736656432656236653930623663616133336435313337
36623031663333386362306138343231363130626131323735316562363730656230376132303439
36323932666362613237666164653037353631353730346466303764326162366266376130316166
32363739373437333731643936366334376463383664373139363465666538666331636535626462
32323834616338376264393461626665393635336638383333653466336332316364363330333738
61303161303564383563653039653263343161336362373563616237373865653965343639343465
35363536613233313534633665373264303139393731626339646466663431363361373938623334
38613766643861326538663563656662383665376137393333616566646136336339306333653066
34373864353230343032386236386165616462316562363062613330636264303632396339646632
37316630303536316436356138626533653865366137666131363064643964333838633266366365
64663661333764616635383263376662616239323930643261613161313265633236623834376263
31623565633964376632346533373037333166346332313266316138613665353530336562643739
32393161396338353630363838643130323431343339376431373165313238383064616335323064
36313366633161303635383062656538343538363039343931623736623766343762343563646134
33626264643639333364343131636163646361626130646237326435373731613237663736393439
37376639333930396337333938373866383133613730613162356364323265373431633836653838
34323532613437313064383035313030306636346435396666653933626232313638656531366234
34313837623136656361393230653637633535333063333662363137323962353232386366656264
30303164363531343261626262653962383664313131333535313038343461303464326464373337
34646537353031386265313066313136613533663335306636346237613264313061666233376131
62346537666362373539626334376630633539343932623133653431393731356266623730353036
64626133623638303132356639663538363537623739386166333337333431363939666362663137
62303664306663376136353235613031623435393065376635353032666136396332613861376630
65633061623466313838383664613839663033333736396536333863636435306263666466313265
62633539623037616535333164316538616439333838633730313066366232616566646435376530
66316164323737396230373339333936313532343266303765356530633534643439626236313136
65373833633461393734353737363566353634353764333961643033393932353236633336393436
61333537666263666238303736316462356138396232373839343434643730643766333535643565
38333163353634633637393766346261613931663134363230353633336533643339353832653632
64343438353266343937373138643635616331336164316166343536643434616665326331353161
39303732663037653634303263386134366536333830363366663639383033323832653364393766
30333438313361613764633239373036336230353333343262613761323930656265313031323065
39666562393565326139373061313061396265386239343462346535623766313364343136343038
39373462663434633731636662653966383233396163643137373530303134633465643130383265
61376538626365396236643139336366643966306131393635623438393932313164623766353233
61643732303837366139356236353937303036343232363537623231303661653035383831343830
64663763383563303461633335313663643161336435343735333536393661663235636665383662
37393139333361323136366564383132633830386335376137396563343937306431653665316161
38323137643437383636373033326236613936396564626466386432393733633361623032326135
61346166393964313637356330653339646365326365326130386537343535353038643538393336
66366335316538393333613631346365393038623261303536363732383637643430346632343139
61643265333466323666633834333462613161653165663432613934353036343937343939303033
35636134343761666534656636383632363562633634383364323039613431666239346136616231
37383838316338666462376133613632663633663935643563346333356464663434393734366433
37376539366139396536323535316539643261636533303065326164643132313439313632306664
33386136393734613739396336396635353439393531393363326137363562646363333762386135
32376162373766393763343634326434323034336533336166666635636135393066353238626161
37376132306339626263313663376638633337656162333431313439643930303332666138643962
37313331616563643638343464653535653038613136313637336534636537343763376634626538
64633133656237346461346330333061636663336262646264326237373736366337663331323764
65353931373266336232366434356631383338386537616535656664323334363963666631363331
37653666316236613931386161346439663935656466396137643765626632643263323163623138
34326363373633303365353530383633623936313436616635353733643837656233613635383966
37356665626530626532356632323338623062386332616332643061623031366366613433383734
33623732636637363237336439373432616332643638303131363332393230663565323139303163
36643134363861383834656539626166386164326236336266633435626163383437366338353930
33373932333832373237343532623537363931366636346132616162343839303965386337316164
61656233616633323933306165643666306661366632613933383932616664613663663234653431
30306163346630653239323966396638643162303766363131646430303366303435343866353639
66373465393764396335346131346331353561643434633364656530626238326333333731383361
35653232373235383633616634643966636336333461663237653764626534346336
34336231623938346631313932323131336439623837626366646338396137633436646365386639
6332383765386235396331373836366230663563376665380a616436373136633933376435653230
64333963663436393265666434653164643164616134353665306462326666623530383838343135
3531343533656332350a343432336636316131386132306238653736633966363235623833343638
38643061383963396466346536343061653034333037393664356661376565643765306462626231
39326233363962373839303464333833306532343834306232653731326135653934643836323639
36343937626536346331613263663865346634666534646266623061303639626636393230616261
32336366356439353738633234326138656464656630303362623664616634306230623538373965
32346439306337623737616666353830626630373562366436653131393532313035303836326430
64613235646366616533313065396663366434363832333535336631323366336437396664303834
30336466313064636565326564356435306136396363373464326534303366323262303732626661
38326663313332633530353739346538343434316133343066313530366637376135323564306537
65626261303231656432333364333965663065346436626631666466643934623064333163626339
32633565303734303862326365336339346133393431636266303530626564326361653230626536
32313231373037633134623761663832393666353732613965613436323939343233613433343538
37326438383130303861316663396333376662386337353964633930353536653437653061356635
35646232343535313130646237643835376162623639333961323964353830653366626438346237
36343663346332656537363434396633336161373730663364306239306432343930643230656465
37633537616232656661313764626232303535383563353861396431643735326162383866626231
61383165613332666537656137636430323332326335323763303537386662646263353539613964
37323966306364306436653033393931663239383435613836356164633135306233356364313036
39356661613434633930633066646437636535313565356366303732613731333062643231313035
65333461396131663764626665393562623030343561313136363964393664376136303839333664
65313465623331333538393734373264313562643232666130303930333662616465656432363039
66616530336666343861336434633063343561323931323931346132376263376565313366306639
64646465303432333136353661323936633965666364356633653861363139616562653834313861
63306133613066373462383236613939316130623937643939323134343936356638376335323836
39383334656236633037633230313138326238303863623231353465346661663162623138353461
33343738613137366364633730346261366564646161373837613865393233663431636361663962
38313230363737306265636435353533666262333666383639343364633464396566333433333538
39643934646537653234336361613664333434623739353831316531313666396638333136343638
33653034366362363562633462303165626333306664326366353334363964663936616430643662
30616334326638323133366632663237356238353934323361376237613632396134663536336364
39363439326335363437373939353564646663616464663763353931323233316135656634343137
34396130386134386331643534353461663963323435656337653032376565313635623231343135
34303130316239303065386134663332393938636332363665643832326439653733633231346537
63383634333034323434376237663932613638363835393837613632663265616363303233653539
61333765313463616665613136303533343230303735626437343635303934613365326166333966
66613538393466666630363333643730653239393435616634303430396635383631613439623433
36646431393865666162373232343335356366366633633264326639643434396234313863333163
63396534623931633833656565396635333133376165613031663831633564663061656131303564
61303132666264636139313738643161313134643733633366376538366135663135333333333564
64366262353837363061653663616265393264373230346330636465336439623063636639356136
65383638643961326661396336373163643832366561363764626461623662333436373136616437
30316537653432356133616338353165633462643634323563306366343965326635363863316232
61633135643861333635383464383937306236626632366235363433313335663431366531356337
37303465323638383930336138356665343966336137356137656564303733373565366162343330
38326366653733376138356339313564616165626235356363343430353239616339656239323964
31643734653263653461333135386261646265323134633334376262323330396634643764323635
30336262323035613338333166353364333836623865393132613338393237363734616330366463
64646163303337323531636532383438356237306337656439663565643032633462316366663164
33613039326337353531303831313136653539353261373930613030383134653261363833653439
31343662623035393238646263633066653362323434306137633339393330376462356139333362
35363436356530363134663064653031376561343732346262383333353733363136396262643135
31326566303535343833326562376464643632363434323839366366626134303830323563633237
37313964353033316163303738636632346137353437333463303135323631383132623133663130
32373163393861366137303138363134653534613236636439623731393837306130626638343134
39313532386338343662333134353761653162663665396664366239633536613132313735373334
37613161383633653861376433633632333163653439633938386137313632396137616337373465
65383238396439666537313833663364333731613434333739393161363437306665363834653761
34303464386633633163353636643964393233383232623765373239376633393139326630653765
62646439646534376234323661383063656463313437323231333165626163626262626562376338
62646362346261313738323830613037663035666361386139666432613230346334323063326239
65303065343061613736343663363630336333623439383032313137616131623933323636306331
34636130626338303039356137353532346562363531623936316162336663306437386532363236
36333661316161613237343032623764396435346632363963643438316430666539393566353939
33333234313839636537366465356364303438313830663261373563346538626432313139303030
33333066626463663663643833323764643737386162663766356665643064313263376434353038
37643630643737663566653562353261333734636262626437393239383063613661643166626630
31313564346239396561326162333534376264616435313762623032636432363832383630343964
30343663643935633465393465626131633931623930653962303830333065363435383237653566
65646632376330306437663334313932653230653562356338663366616463303466366263366137
64633934626339633235386630396561376130373763313137386531356637633863393035306634
65353432323235363135633832373032623837376333346131303162303464616234313062316563
64646634633963663032613533636665333335656539323238623362306363313835626632306236
30663637356463363530316434316639326639633539333335633330333834643035353932313638
64356565653065666131373538356462306633343161376537323762313666373235353236313963
65613561633266306632616538616461626532666435663038646138386430376164663766363138
35316262393065653739323035666531333330326235386133383834383865356635666537333533
31376138353231313262646334386566376264323066373934666363313431643738383064666437
36656437313039656666373530346534393735353163646635663839326366643333393665626464
36616637303631653661373433653865323634363065303433386534363064356564636465366265
31333064383233636538393032376234663663353162343530376631356533653231303730396465
33366162376464633633313664303939306330613865663431653037303061633130626635653638
66626264363333376463386666313663333964333137333231303361616533393236373861656534
32326335306566623332396638383133353434363565316432353963353062313662326361336537
34396632656234333263663831326566353434316234613365316132363730643665373761666562
31393565653663653731633333633730326265376135666162656132623238333765333363653130
61353632313532616266363139336162336565356365316531336364623930636430353831623233
61616131313438306633333066613764313161333934316139633738623164623564646365663566
66356464376133363137313036623930373362306166623838373131313330393837396261656561
66396233313530643164353264656563383632363139333262626532376562613630643437666266
66656335656634613138316138643666623430363833663035616138336461303035633731636262
36393939333765346239666433323032323361343934656463396365333366623337316663396263
36616431626633663963636135643833666234613830366434636532373031343263316436306162
39356365376561643665323866656465313434623138326238353662653735613565623264333336
61393763363862613766653064636130323732663466366133666361636339356464313037353462
63633936653235656538383433393065393162643034393538666433616131343462346235393164
39353663373338626665663563663162633430343330373430376336326432346233663365376533
32656465343538643137326366653232343530363834383831386634366262303333636261353863
32633437343432653936643766363338636535613532323362656435613363393238626466303861
38633861333638613466306338613932353964393365356637306261626535323732316362623731
33313963623439613939333639346461663338373334396165636231666266613065323731373964
64313133383435333935376531313432663766633133633863356563663535333263636237386136
61653963633166383135333436646465383536373039383538326366636634313061613730653962
37623962643866396637336231363038373465393637356463656566666661313130313863383233
37343636346535363832626365396262303862393535336565393635663637323730373564336634
37363036323733306535336366373630356531353737303165376530656433626634343365626239
64346136363030663862313431653761666432393933366665346361626361623039326434633835
32666538653037613361343536383634643762356234366433663639653461303933306434333864
37386436393465323139306161333738383265323436376536656264356230303163326134323864
63396331666431666464656161633466333764653631623131646566303366333030653834333335
31323365353239366232643863386365633861376235643034303563613363663661616564363663
63326562613365653539383336383339646164623864323830653434623365393432666466323134
33626330373361393734656632393232363866613863373135636537613934343065306265623964
34643765636165393336356630353663343065333431656164363638646233663762346536343362
65653364343537383336373933313464663464653465383830363631316336303464313731356230
34336130323766386465373162346535396565346630353734303937396130656132376331326563
36386339383338346533646331666262396432336434646333653664326635386238333763626637
31363464306465666339316436323265623437636533643431363161323139653065323534636533
64386334353439373133313937343234373963353331646233346432646430636530663336316134
66303337313034396232643531643262343036313762633165353665653938313665386363353865
66333166303636626565613136653365313763303263313239333033353638616566656134396131
38356434343931303134303362313363343634613361353538636634336332373132356165326163
30386130326239366532363962316435663862393836326439623862366166376234343439306465
36346639623939353232366333643963646336383833386565643435393734653936313638663930
32323065343737663564333961373034393261613862333431663562353964666561643831316432
35313832356639333937333266306166656538643065386639346337306134613536356137316331
38376434666332366531393639303561663934353130333161636530383932653236313530616531
61656664626663373164343863333039356362343034326131376666623264663732303734366363
30306430353732616131346637626332656434393163313661356465393263393235396662623962
62643538623331646265643561623366383937313136383939366164613235666234663137653432
34316138643139336331356663333632656539653632626136613431393736613630353237356164
33623632643335663163656236633134343464353837346237316162346634633336663564656531
39373730346130363963376463326238366235613539613466653139306237343164336462353236
39323361636333353661633863663162633563343937366461346338363061623730633537626562
30353938383664333861366431343033313961376436363065373430353736343563313531386663
37313534303564333237616331396437376436383833373936376664666366373235613533663239
64653863613531356666646233393533646131333961343730663461346235633961306263343831
64386332653330323937643266373437633465363933653833343930616134626566363339366362
36356163333730656233653431326430326566386264343330666131393166323537623137396237
65386234653231666631366533383762643830333261363532666138386263643662633932626335
66303363613035643931393933303035323566373634663037313338616132373162366334373962
33666463613435396331326565353433336361303562326562663035313639333232333430373266
65383235356132353838636565636436356361653831356430663935613766613237366564316566
37396130393363386566306162346466326165353863636633306335383265306139396339383866
34326335323962633032386162623033353036643437313832323166363764653339343638343964
66626662326234306362656162336538353131366337643761643930306163333661653062663832
61303963623433313565633235306132366663336662616232613339366363373934613631623431
34323736383366333032343364373533363761323338346163323836653235653136646162306166
65333734623663346233343961396566313838653036396430396134393839326535363237363638
38333232333863396334366561303136333863356666656335633630616531363766343535616533
35656166303837653365303436623431613931336331356531666665346562613263363666626238
62626236323863383366643162356462306163653032626130333863656337623136646439316337
33306432663134383038646133346131333732633932383239643733643138303434646565663266
34616265383733343963323538656138656331396438616133393063356638633965323363653066
65353837333363613762333839313631373137363064383830353565333832356162323862393030
35373038613133643466636537626437393837633865363566343565626633376262373766613738
39343334336238363131373762646564653839623531323066356430326263376534373664363331
64373735383933303638303661333964333464306338613363326261623438336530636262373766
35346339643939666162386232666236326131366366303432393838326239313730323431376231
39363032616666393431326533643865643937363937356431623763363037373333653266376561
63323462363063343234373534663063353865363037383932386231313338343239653131633561
34623439396232633265616438623562666333303932396366663330326565363736633461333463
66346537323061306662323062393061353565393165363532306439343262343632616465363364
30376331346430313536313963333136663833323064633631653935326366633862336163316538
33383434336666303434363236396662366664393637656462363331356631613332353766636663
62323264336235306532343065323834313730353237616463373766303439663533336366363565
35646461636263646633343634323735383235376330616334373937646165623639363663353361
65613034353736633332663333616564356265323731613537393430633137333337643663323137
31623732663331653935316337306433333633353565343265666333363864346562363961333439
30656136636661396335623566386362333861616663393738626632633537613564636261383138
3233

View file

@ -0,0 +1,8 @@
---
apartment_block: aurore
apartment_block_id: 0
router_ip_suffix: 254
# We have two -aurore DHCP servers, but no failover peer functionality is needed
# because they only give out IPs assigned by re2o.
dhcp_failover_enabled: false

View file

@ -0,0 +1,3 @@
---
ldap_local_replica_uri:
- 'ldap://ldap-replica-edc.adm.auro.re'

7
group_vars/edc/main.yml Normal file
View file

@ -0,0 +1,7 @@
---
apartment_block: edc
apartment_block_id: 4
router_ip_suffix: 254
mtu: 1500

View file

@ -0,0 +1,3 @@
---
# Users in that group will be able to `sudo`
sudo_group_location: 'sudoedc'

View file

@ -0,0 +1,7 @@
---
apartment_block: fleming
apartment_block_id: 1
router_ip_suffix: 254
mtu: 1500

View file

@ -0,0 +1,3 @@
---
# Users in that group will be able to `sudo`
sudo_group_location: 'sudofleming'

7
group_vars/gs/main.yml Normal file
View file

@ -0,0 +1,7 @@
---
apartment_block: gs
apartment_block_dhcp: sand
apartment_block_id: 5
router_ip_suffix: 254

View file

@ -0,0 +1,3 @@
---
# Users in that group will be able to `sudo`
sudo_group_location: 'sudogeorgesand'

View file

@ -0,0 +1,7 @@
---
apartment_block: pacaterie
apartment_block_id: 2
router_ip_suffix: 254
mtu: 1500

View file

@ -0,0 +1,3 @@
---
# Users in that group will be able to `sudo`
sudo_group_location: 'sudopacaterie'

View file

@ -0,0 +1,7 @@
---
apartment_block: rives
apartment_block_id: 3
router_ip_suffix: 254
mtu: 1500

View file

@ -0,0 +1,3 @@
---
# Users in that group will be able to `sudo`
sudo_group_location: 'sudorives'

View file

@ -0,0 +1,64 @@
---
certbot:
domains:
- auro.re
- cas.auro.re
- codimd.auro.re
- grafana.auro.re
- pad.auro.re
- passbolt.auro.re
- phabricator.auro.re
- privatebin.auro.re
- riot.auro.re
- sharelatex.auro.re
- status.auro.re
- wiki.auro.re
- www.auro.re
mail: tech.aurore@lists.crans.org
certname: auro.re
nginx:
ssl:
cert: /etc/letsencrypt/live/auro.re/fullchain.pem
cert_key: /etc/letsencrypt/live/auro.re/privkey.pem
trusted_cert: /etc/letsencrypt/live/auro.re/chain.pem
redirect_dnames:
- aurores.net
- fede-aurore.net
redirect_tcp: {}
redirect_sites:
- from: www.auro.re
to: auro.re
- from: 92.222.211.195
to: auro.re
reverseproxy_sites:
- from: phabricator.auro.re
to: 10.128.0.50
- from: wiki.auro.re
to: 10.128.0.51
- from: www.auro.re
to: 10.128.0.52
- from: passbolt.auro.re
to: 10.128.0.53
- from: riot.auro.re
to: "10.128.0.150:8080"
- from: codimd.auro.re
to: "10.128.0.150:8081"
- from: grafana.auro.re
to: "10.128.0.150:8082"
- from: privatebin.auro.re
to: "10.128.0.150:8083"
- from: pad.auro.re
to: "10.128.0.150:8084"
- from: cas.auro.re
to: "10.128.0.150:8085"
- from: status.auro.re
to: "10.128.0.150:8086"

View file

@ -0,0 +1,63 @@
---
certbot:
domains:
- bbb.auro.re
- drone.auro.re
- gitea.auro.re
- intranet.auro.re
- litl.auro.re
- nextcloud.auro.re
- re2o.auro.re
- vote.auro.re
- re2o-server.auro.re
- re2o-test.auro.re
- wikijs.auro.re
mail: tech.aurore@lists.crans.org
certname: auro.re
nginx:
ssl:
cert: /etc/letsencrypt/live/auro.re/fullchain.pem
cert_key: /etc/letsencrypt/live/auro.re/privkey.pem
trusted_cert: /etc/letsencrypt/live/auro.re/chain.pem
redirect_dnames:
- aurores.net
- fede-aurore.net
redirect_tcp:
- name: Gitea
port: 2222
destination: "10.128.0.60:2222"
redirect_sites:
- from: 45.66.111.61
to: auro.re
reverseproxy_sites:
- from: re2o.auro.re
to: 10.128.0.20
- from: intranet.auro.re
to: 10.128.0.20
- from: bbb.auro.re
to: 10.128.0.54
- from: nextcloud.auro.re
to: "10.128.0.58:8080"
- from: gitea.auro.re
to: "10.128.0.60:3000"
- from: drone.auro.re
to: "10.128.0.64:8000"
- from: litl.auro.re
to: 10.128.0.35
- from: re2o-test.auro.re
to: 10.128.0.80
- from: wikijs.auro.re
to: "10.128.0.66:3000"

268
hosts
View file

@ -1,70 +1,260 @@
# Aurore servers inventory
# How to name your server ?
# > We name servers according to location, then type.
# > So all containers at OVH are in ovh-container.
# > Then we regroup everything in global geographic and type groups.
# > We name servers according to location, then type, then function.
# > Then we regroup everything in global geographic, type and function groups.
[ovh-pve]
horus ansible_host=10.128.0.1
[ovh-container]
riot.adm.auro.re
###############################################################################
# Aurore : main services
viviane.adm.auro.re
[aurore_pve]
merlin.adm.auro.re
[aurore_vm]
routeur-aurore.adm.auro.re
routeur-aurore-backup.adm.auro.re
radius-aurore.adm.auro.re
dhcp-aurore.adm.auro.re
dhcp-aurore-backup.adm.auro.re
dns-aurore.adm.auro.re
proxy.adm.auro.re
camelot.adm.auro.re
gitea.adm.auro.re
drone.adm.auro.re
nextcloud.adm.auro.re
stream.adm.auro.re
re2o-server.adm.auro.re
re2o-ldap.adm.auro.re
re2o-db.adm.auro.re
pendragon.adm.auro.re
services-bdd-local.adm.auro.re
backup.adm.auro.re
services-web.adm.auro.re
mail.adm.auro.re
wikijs.adm.auro.re
###############################################################################
# OVH
[ovh_pve]
horus.adm.auro.re
[ovh_container]
synapse.adm.auro.re
codimd.adm.auro.re
services-bdd.adm.auro.re
phabricator.adm.auro.re
wiki.adm.auro.re
www.adm.auro.re
pad.adm.auro.re
proxy.adm.auro.re
proxy-ovh.adm.auro.re
matrix-services.adm.auro.re
[ovh-vm]
re2o-server.adm.auro.re
re2o-ldap.adm.auro.re
re2o-db.adm.auro.re
[ovh_vm]
serge.adm.auro.re
passbolt.adm.auro.re
vpn-ovh.adm.auro.re
docker-ovh.adm.auro.re
switchs-manager.adm.auro.re
ldap-replica-ovh.adm.auro.re
[ovh-testing-vm]
re2o-test.adm.auro.re
[ovh_testing_vm]
#re2o-test.adm.auro.re
[fleming-pve]
#freya.adm.auro.re
#odin.adm.auro.re
[fleming-vm-ldap-replica]
#ldap-replica-fleming1.adm.auro.re
#ldap-replica-fleming2.adm.auro.re
###############################################################################
# Les Jardins de Fleming
[fleming_pve]
freya.adm.auro.re
marki.adm.auro.re
[fleming_vm]
ldap-replica-fleming.adm.auro.re
dhcp-fleming.adm.auro.re
dhcp-fleming-backup.adm.auro.re
dns-fleming.adm.auro.re
dns-fleming-backup.adm.auro.re
prometheus-fleming.adm.auro.re
#prometheus-fleming-fo.adm.auro.re
radius-fleming.adm.auro.re
radius-fleming-backup.adm.auro.re
unifi-fleming.adm.auro.re
routeur-fleming.adm.auro.re
routeur-fleming-backup.adm.auro.re
###############################################################################
# Pacaterie
[pacaterie_pve]
mordred.adm.auro.re
titan.adm.auro.re
[pacaterie_vm]
ldap-replica-pacaterie.adm.auro.re
dhcp-pacaterie.adm.auro.re
dhcp-pacaterie-backup.adm.auro.re
dns-pacaterie.adm.auro.re
dns-pacaterie-backup.adm.auro.re
prometheus-pacaterie.adm.auro.re
#prometheus-pacaterie-fo.adm.auro.re
radius-pacaterie.adm.auro.re
radius-pacaterie-backup.adm.auro.re
unifi-pacaterie.adm.auro.re
routeur-pacaterie.adm.auro.re
routeur-pacaterie-backup.adm.auro.re
###############################################################################
# Emilie du Chatelet
[edc_server]
perceval.adm.auro.re
[edc_pve]
chapalux.adm.auro.re
escalope.adm.auro.re
[edc_vm]
routeur-edc.adm.auro.re
routeur-edc-backup.adm.auro.re
dns-edc.adm.auro.re
dns-edc-backup.adm.auro.re
dhcp-edc.adm.auro.re
dhcp-edc-backup.adm.auro.re
unifi-edc.adm.auro.re
radius-edc.adm.auro.re
radius-edc-backup.adm.auro.re
ldap-replica-edc.adm.auro.re
###############################################################################
# George Sand
[gs_pve]
lancelot.adm.auro.re
odin.adm.auro.re
[gs_vm]
dhcp-gs.adm.auro.re
dhcp-gs-backup.adm.auro.re
dns-gs.adm.auro.re
dns-gs-backup.adm.auro.re
routeur-gs.adm.auro.re
routeur-gs-backup.adm.auro.re
unifi-gs.adm.auro.re
radius-gs.adm.auro.re
radius-gs-backup.adm.auro.re
prometheus-gs.adm.auro.re
ldap-replica-gs.adm.auro.re
###############################################################################
# Les Rives
[rives_pve]
thor.adm.auro.re
[rives_vm]
dhcp-rives-backup.adm.auro.re
unifi-rives.adm.auro.re
dns-rives-backup.adm.auro.re
radius-rives-backup.adm.auro.re
routeur-rives-backup.adm.auro.re
ldap-replica-rives.adm.auro.re
# -aurore services
[aurore:children]
aurore_vm
# everything at ovh
[ovh:children]
ovh-pve
ovh-container
ovh-vm
# everything at ovh-testing
[ovh-testing:children]
ovh-testing-vm
ovh_pve
ovh_container
ovh_vm
# everything at fleming
[fleming:children]
fleming-pve
fleming-vm-ldap-replica
fleming_pve
fleming_vm
#fleming_unifi
# everything at pacaterie
[pacaterie:children]
pacaterie_pve
pacaterie_vm
#pacaterie_unifi
# everything at edc
[edc:children]
edc_pve
edc_vm
# everything at georgesand
[gs:children]
gs_pve
gs_vm
# everything at Les Rives
[rives:children]
rives_pve
rives_vm
###############################################################################
# Groups by type
# every LXC container
[container:children]
ovh-container
ovh_container
# every virtual machine
[vm:children]
ovh-vm
fleming-vm-ldap-replica
ovh_vm
fleming_vm
pacaterie_vm
edc_vm
gs_vm
rives_vm
# every PVE
[pve:children]
ovh-pve
fleming-pve
ovh_pve
fleming_pve
pacaterie_pve
edc_pve
gs_pve
rives_pve
###############################################################################
# Groups by service
[ldap_replica:children]
ldap_replica_fleming
ldap_replica_pacaterie
ldap_replica_edc
ldap_replica_gs
ldap_replica_ovh
ldap_replica_rives
[ldap_replica_fleming]
ldap-replica-fleming.adm.auro.re
[ldap_replica_pacaterie]
ldap-replica-pacaterie.adm.auro.re
[ldap_replica_edc]
ldap-replica-edc.adm.auro.re
[ldap_replica_gs]
ldap-replica-gs.adm.auro.re
[ldap_replica_ovh]
ldap-replica-ovh.adm.auro.re
[ldap_replica_rives]
ldap-replica-rives.adm.auro.re
# every LDAP replica
[ldap-replica:children]
fleming-vm-ldap-replica

View file

@ -1,11 +0,0 @@
---
# Plug LDAP on all servers
- hosts: all
roles:
- ldap-client
# Clone LDAP on local geographic location
# DON'T DO THIS AS IT RECREATES THE REPLICA
# - hosts: ldap-replica
# roles:
# - ldap-replica

7
ldap_replica.yml Executable file
View file

@ -0,0 +1,7 @@
#!/usr/bin/env ansible-playbook
---
# Clone LDAP on local geographic location
# DON'T DO THIS AS IT RECREATES THE REPLICA
- hosts: ldap_replica
roles:
- ldap_replica

19
matrix.yml Normal file → Executable file
View file

@ -1,15 +1,18 @@
#!/usr/bin/env ansible-playbook
---
# Install Matrix Synapse on corresponding containers
- hosts: synapse.adm.auro.re
vars:
mxisd_version: 1.3.1
synapse_rest_auth_url: https://raw.githubusercontent.com/kamax-matrix/matrix-synapse-rest-auth/master/rest_auth_provider.py
mxisd_releases: https://github.com/kamax-matrix/mxisd/releases
mxisd_deb: "{{ mxisd_releases }}/download/v1.3.1/mxisd_1.3.1_all.deb"
roles:
- debian-backports
- matrix-synapse
- matrix-mxisd
- debian_backports
- nodejs
- matrix_synapse
- matrix_appservice_irc
- matrix_appservice_webhooks
# Install Matrix Riot on corresponding containers
- hosts: riot.adm.auro.re
# Install Matrix services
- hosts: matrix-services.adm.auro.re
roles:
- matrix-riot
- debian_backports

62
monitoring.yml Executable file
View file

@ -0,0 +1,62 @@
#!/usr/bin/env ansible-playbook
---
- hosts: prometheus-fleming.adm.auro.re,prometheus-fleming-fo.adm.auro.re
vars:
prometheus_alertmanager: docker-ovh.adm.auro.re:9093
snmp_unifi_password: "{{ vault_snmp_unifi_password }}"
# Prometheus targets.json
prometheus_targets:
- targets: |
{{ groups['fleming_physical'] + groups['fleming_vm'] | list | sort }}
prometheus_unifi_snmp_targets:
- targets: "{{ groups['fleming_unifi'] | list | sort }}"
roles:
- prometheus
- hosts: prometheus-pacaterie.adm.auro.re,prometheus-pacaterie-fo.adm.auro.re
vars:
prometheus_alertmanager: docker-ovh.adm.auro.re:9093
snmp_unifi_password: "{{ vault_snmp_unifi_password }}"
# Prometheus targets.json
prometheus_targets:
- targets: |
{{ groups['pacaterie_physical'] + groups['pacaterie_vm'] | list | sort }}
prometheus_unifi_snmp_targets:
- targets: "{{ groups['pacaterie_unifi'] | list | sort }}"
roles:
- prometheus
- hosts: prometheus-edc.adm.auro.re,prometheus-edc-fo.adm.auro.re
vars:
prometheus_alertmanager: docker-ovh.adm.auro.re:9093
snmp_unifi_password: "{{ vault_snmp_unifi_password }}"
# Prometheus targets.json
prometheus_targets:
- targets: |
{{ groups['edc_physical'] + groups['edc_vm'] | list | sort }}
prometheus_unifi_snmp_targets:
- targets: "{{ groups['edc_unifi'] | list | sort }}"
roles:
- prometheus
- hosts: prometheus-georgesand.adm.auro.re,prometheus-georgesand-fo.adm.auro.re
vars:
prometheus_alertmanager: docker-ovh.adm.auro.re:9093
snmp_unifi_password: "{{ vault_snmp_unifi_password }}"
# Prometheus targets.json
prometheus_targets:
- targets: |
{{ groups['georgesand_physical'] + groups['georgesand_vm'] | list | sort }}
prometheus_unifi_snmp_targets:
- targets: "{{ groups['georgesand_unifi'] | list | sort }}"
roles:
- prometheus
# Monitor all hosts
- hosts: all,!unifi,!ovh
roles:
- prometheus_node

65
network.yml Executable file
View file

@ -0,0 +1,65 @@
#!/usr/bin/env ansible-playbook
---
# Set up DHCP servers.
- hosts: dhcp-*.adm.auro.re
roles:
- isc_dhcp_server
# Deploy unbound DNS server (recursive).
- hosts: dns-*.adm.auro.re,!dns-aurore*.adm.auro.re
roles:
- unbound
# Déploiement du service re2o aurore-firewall et keepalived
# radvd: IPv6 SLAAC (/64 subnets, private IPs).
# Must NOT be on routeur-aurore-*, or will with DHCPv6!
- hosts: ~routeur-(pacaterie|edc|fleming|gs|rives).*\.adm\.auro\.re
roles:
- router
- radvd
# No radvd here
- hosts: ~routeur-aurore.*\.adm\.auro\.re
roles:
- router
- ipv6_edge_router
# Radius (backup only for now)
- hosts: radius-*.adm.auro.re
roles:
- radius
# WIP: Deploy authoritative DNS servers
# - hosts: authoritative_dns
# vars:
# service_repo: https://gitlab.crans.org/nounous/re2o-dns.git
# service_name: dns
# service_version: crans
# service_config:
# hostname: re2o-server.adm.auro.re
# username: service-user
# password: "{{ vault_serviceuser_passwd }}"
# roles:
# - re2o-service
# Deploy Unifi Controller
# - hosts: unifi-fleming.adm.auro.re,unifi-pacaterie.adm.auro.re
# roles:
# - unifi-controller
# Deploy Re2o switch service
# - hosts: switchs-manager.adm.auro.re
# vars:
# service_repo: https://gitlab.federez.net/re2o/switchs.git
# service_name: switchs
# service_version: master
# service_config:
# hostname: re2o-server.adm.auro.re
# username: service-user
# password: "{{ vault_serviceuser_passwd }}"
# roles:
# - re2o-service

View file

@ -1,34 +0,0 @@
---
# Install NGINX with reverse proxy conf
- hosts: proxy.adm.auro.re
vars:
reversed_proxy_subdomains:
- name: re2o
from: re2o.auro.re
to: re2o-server.adm.auro.re
- name: intranet
from: intranet.auro.re
to: re2o-server.adm.auro.re
- name: pad
from: pad.auro.re
to: pad.adm.auro.re:9001
- name: phabricator
from: phabricator.auro.re
to: phabricator.adm.auro.re
- name: wiki
from: wiki.auro.re
to: wiki.adm.auro.re
- name: www
from: www.auro.re
to: www.adm.auro.re
- name: re2o-test
from: re2o-test.auro.re
to: re2o-test.adm.auro.re
- name: riot
from: riot.auro.re
to: riot.adm.auro.re
- name: codimd
from: codimd.auro.re
to: codimd.adm.auro.re:8080
roles:
- nginx-reverse-proxy

7
nuke_radius_dbs.yml Executable file
View file

@ -0,0 +1,7 @@
#!/usr/bin/env ansible-playbook
---
- hosts: radius-*.adm.auro.re
roles:
- radius
vars:
nuke_radius: true

432
proxmox.yml Executable file
View file

@ -0,0 +1,432 @@
#!/usr/bin/env ansible-playbook
---
# This is a special playbook to create a new VM !
- hosts: proxy.adm.auro.re # Host with python-proxmoxer and python-requests
become: false # We do not need root as we use Proxmox API
vars:
vm_definitions:
# Réseau Pacaterie
- name: ldap-replica-pacaterie
virtu: mordred
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: dhcp-pacaterie
virtu: mordred
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: dns-pacaterie
virtu: mordred
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: prometheus-pacaterie
virtu: mordred
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: radius-pacaterie
virtu: mordred
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: unifi-pacaterie
virtu: mordred
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-9.9.0-amd64-netinst.iso
# Réseau Fleming
- name: ldap-replica-fleming1
virtu: freya
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: dhcp-fleming
virtu: freya
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: dns-fleming
virtu: freya
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: prometheus-fleming
virtu: freya
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: radius-fleming
virtu: freya
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: unifi-fleming
virtu: freya
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-9.9.0-amd64-netinst.iso
# Réseau EdC
- name: ldap-replica-edc1
virtu: chapalux
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: dhcp-edc
virtu: chapalux
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: dns-edc
virtu: chapalux
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: prometheus-edc
virtu: chapalux
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: radius-edc
virtu: chapalux
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: unifi-edc
virtu: chapalux
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-9.9.0-amd64-netinst.iso
# Réseau George Sand
- name: ldap-replica-gs1
virtu: perceval
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: dhcp-gs
virtu: perceval
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: dns-gs
virtu: perceval
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: prometheus-gs
virtu: perceval
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: radius-gs
virtu: perceval
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: unifi-gs
virtu: perceval
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-9.9.0-amd64-netinst.iso
vars_prompt:
- name: "password"
prompt: "Enter LDAP password for your user"
private: true
tasks:
- name: Define a virtual machine in Proxmox
proxmox_kvm:
api_user: "{{ ansible_user_id }}@pam"
api_password: "{{ password }}"
api_host: "{{ item.virtu }}.adm.auro.re"
name: "{{ item.name }}"
node: "{{ item.virtu }}"
scsihw: virtio-scsi-pci
scsi: '{"scsi0":"{{ item.virtu }}:{{ item.disksize }},format=raw"}'
sata: '{"sata0":"local:iso/{{ item.installiso }},media=cdrom"}'
net: '{"net0":"virtio,bridge=vmbr2"}' # Adm only by default
cores: "{{ item.cores }}"
memory: "{{ item.memory }}"
balloon: "{{ item.memory // 2 }}"
bios: seabios # Ansible module doesn't support UEFI boot disk
loop:
# Réseau Fleming
- name: ldap-replica-fleming
virtu: freya
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: dhcp-fleming
virtu: freya
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: dns-fleming
virtu: freya
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: prometheus-fleming
virtu: freya
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: radius-fleming
virtu: freya
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: unifi-fleming
virtu: freya
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-9.9.0-amd64-netinst.iso
- name: routeur-fleming
virtu: freya
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: ldap-replica-fleming-fo
virtu: marki
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: dhcp-fleming-fo
virtu: marki
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: dns-fleming-fo
virtu: marki
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: prometheus-fleming-fo
virtu: marki
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: radius-fleming-fo
virtu: marki
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: routeur-fleming-fo
virtu: marki
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
# Réseau Pacaterie
- name: ldap-replica-pacaterie
virtu: mordred
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: dhcp-pacaterie
virtu: mordred
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: dns-pacaterie
virtu: mordred
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: prometheus-pacaterie
virtu: mordred
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: radius-pacaterie
virtu: mordred
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: unifi-pacaterie
virtu: mordred
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-9.9.0-amd64-netinst.iso
- name: routeur-pacaterie
virtu: mordred
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: ldap-replica-pacaterie-fo
virtu: titan
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: dhcp-pacaterie-fo
virtu: titan
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: dns-pacaterie-fo
virtu: titan
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: prometheus-pacaterie-fo
virtu: titan
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: radius-pacaterie-fo
virtu: titan
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: routeur-pacaterie-fo
virtu: titan
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
# Réseau EDC
- name: ldap-replica-edc
virtu: chapalux
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: dhcp-edc
virtu: chapalux
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: dns-edc
virtu: chapalux
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: prometheus-edc
virtu: chapalux
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: radius-edc
virtu: chapalux
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: unifi-edc
virtu: chapalux
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-9.9.0-amd64-netinst.iso
- name: routeur-edc
virtu: chapalux
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
# Réseau George Sand
- name: ldap-replica-georgesand
virtu: perceval
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: dhcp-georgesand
virtu: perceval
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: dns-georgesand
virtu: perceval
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: prometheus-georgesand
virtu: perceval
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: radius-georgesand
virtu: perceval
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso
- name: unifi-georgesand
virtu: perceval
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-9.9.0-amd64-netinst.iso
- name: routeur-georgesand
virtu: perceval
cores: 2 # 2 mimimum, 10 maximum
memory: 1024 # M
disksize: 16 # G
installiso: debian-10.0.0-amd64-netinst.iso

View file

@ -1,6 +1,5 @@
#!/bin/sh
# /etc/update-motd.d/00-logo
# Deployed with Aurore Ansible !
# {{ ansible_managed }}
# Pretty uptime
upSeconds="$(/usr/bin/cut -d. -f1 /proc/uptime)"

View file

@ -0,0 +1,3 @@
#!/bin/sh
# {{ ansible_managed }}
uname -snrvm

View file

@ -6,14 +6,27 @@
name: apt-listchanges
state: present
update_cache: true
register: apt_result
retries: 3
until: apt_result is succeeded
# Send email when there is something new
- name: Configure apt-listchanges
lineinfile:
dest: /etc/apt/listchanges.conf
regexp: "^{{ item.key }}="
line: "{{ item.value }}"
with_dict:
confirm: 'confirm=true'
email_address: "email_address={{ monitoring_mail }}"
which: 'which=both'
ini_file:
path: /etc/apt/listchanges.conf
no_extra_spaces: true
section: apt
option: "{{ item.option }}"
value: "{{ item.value }}"
state: present
mode: 0644
loop:
- option: confirm
value: "true"
- option: email_address
value: "{{ monitoring_mail }}"
- option: which
value: both
...

View file

@ -3,29 +3,48 @@
- name: Install basic tools
when: ansible_os_family == "Debian"
apt:
name: "{{ packages }}"
state: present
name:
- acl # advanced ACL
- apt # better than apt-get
- aptitude # nice to have for Ansible
- bash-completion # because bash
- curl # Better that wget
- emacs-nox # for maman
- fish # to motivate @edpibu
- git # code versioning
- less # i like cats
- lsb-release
- htop # better than top
- iotop # monitor i/o
- oidentd # postgresql identification
- molly-guard # prevent reboot
- nano # for vulcain
- net-tools
- ntp # network time sync
- screen # Vulcain asked for this
- sudo
- tree # create a graphical tree of files
- vim # better than nano
- zsh # to be able to ssh @erdnaxe
update_cache: true
vars:
packages:
- bash-completion # for bash users
- zsh # alternative shell
- sudo # to gain root access
- git # code versioning
- nano # basic text editor
- vim # like nano but more powerful and complex
- htop # better than top
- less # i like cats
- tree # create a graphical tree of files
- ipython # better Python shell
- acl # for Ansible become support
register: apt_result
retries: 3
until: apt_result is succeeded
# Pimp my server
- name: Customize motd
copy:
src: 'update-motd.d/00-logo'
dest: '/etc/update-motd.d/00-logo'
src: "update-motd.d/{{ item }}"
dest: "/etc/update-motd.d/{{ item }}"
mode: 0755
loop:
- 00-logo
- 10-uname
- name: Remove Debian warranty motd
file:
path: /etc/motd
state: absent
# Configure APT mirrors on Debian Stretch
- name: Configure APT mirrors
@ -33,8 +52,8 @@
- ansible_distribution == 'Debian'
- ansible_distribution_release == 'stretch'
template:
src: 'apt/sources.list.j2'
dest: '/etc/apt/sources.list'
src: apt/sources.list.j2
dest: /etc/apt/sources.list
mode: 0644
# Patriotisme
@ -50,11 +69,7 @@
question: locales/default_environment_locale
value: fr_FR.UTF-8
vtype: select
notify:
- Reconfigure locales
# Molly-Guard : prevent accidental shutdowns
- include_tasks: molly-guard.yml
notify: Reconfigure locales
# APT-List Changes : send email with changelog
- include_tasks: apt-listchanges.yml
@ -62,8 +77,15 @@
# User skeleton
- name: Configure user skeleton
copy:
src: skel/{{ item.key }}
dest: /etc/skel/{{ item.value }}
with_dict:
dot_zshrc: .zshrc
dot_zshrc.local: .zshrc.local
src: "skel/dot_{{ item }}"
dest: "/etc/skel/.{{ item }}"
mode: 0644
loop:
- zshrc
- zshrc.local
- name: Configure resolvconf
template:
src: resolv.conf
dest: /etc/resolv.conf
mode: 0644

View file

@ -1,15 +0,0 @@
---
# Install molly-guard
- name: Install molly-guard
when: ansible_os_family == "Debian"
apt:
name: molly-guard
state: present
update_cache: true
# Always ask for hostname
- name: Configure molly-guard
lineinfile:
dest: /etc/molly-guard/rc
regexp: '^#*\s*ALWAYS_QUERY_HOSTNAME.*$'
line: 'ALWAYS_QUERY_HOSTNAME=true'

View file

@ -0,0 +1,4 @@
domain adm.auro.re
nameserver 10.128.0.253
nameserver 2a09:6840:128::253
nameserver 80.67.169.12

View file

@ -0,0 +1,10 @@
---
- name: Restart sshd service
service:
name: sshd
state: restarted
- name: Restart fail2ban service
service:
name: fail2ban
state: restarted

View file

@ -0,0 +1,87 @@
---
- name: Configure sysctl
template:
src: sysctl.d/local.conf.j2
dest: /etc/sysctl.d/local.conf
mode: 0644
# Use this command to list setuid or setgid executables
# find / -type f -perm /6000 -ls 2>/dev/null
- name: Desactivate setuid/setgid on unused binaries
file:
path: "{{ item }}"
mode: u-s,g-s
loop:
- /usr/lib/openssh/sshkeysign # Not used
- /usr/bin/gpasswd # No group auth
- /usr/bin/passwd # Only root should change passwd
- /usr/bin/expiry # With re2o
- /usr/bin/newgrp # No group auth
- /usr/bin/chage # With re2o
- /usr/bin/chsh # With re2o
- /usr/bin/chfn # With re2o
- /bin/mount # Only root should mount
- /bin/umount # Only root should umount
ignore_errors: true # Sometimes file won't exist
# Only SSH keys to log on root
- name: Prohibit root SSH with password
lineinfile:
dest: /etc/ssh/sshd_config
regexp: '^{{ item.0 }}'
insertafter: '^#{{ item.0 }}'
line: '{{ item.0 }} {{ item.1 }}'
loop:
- ["PermitRootLogin", "prohibit-password"]
- ["AllowAgentForwarding", "no"]
- ["X11Forwarding", "no"]
- ["TCPKeepAlive", "yes"]
notify: Restart sshd service
# See banned client with `fail2ban-client status sshd`
- name: Install fail2ban
apt:
name: fail2ban
state: present
register: apt_result
retries: 3
until: apt_result is succeeded
- name: Configure fail2ban
ini_file:
path: /etc/fail2ban/jail.d/local.conf
section: "{{ item.section }}"
option: "{{ item.option }}"
value: "{{ item.value }}"
state: present
mode: 0644
notify: Restart fail2ban service
loop:
- section: sshd
option: ignoreip
value: 10.128.0.254 # Whitelist bastion
- section: sshd
option: enabled
value: "true"
- section: sshd
option: bantime
value: 600
- section: sshd
option: findtime
value: 600
- section: sshd
option: maxretry
value: 5
# See altered packages and configurations with `debsums -ca`
- name: Install debsums
apt:
name: debsums
state: present
register: apt_result
retries: 3
until: apt_result is succeeded

View file

@ -0,0 +1,13 @@
# {{ ansible_managed }}
# See https://www.ssi.gouv.fr/uploads/2016/01/linux_configuration-fr-v1.2.pdf
# Disable core dump of setuid executables
# So an user can't read privileged information in memory
fs.suid_dumpable = 0
# Obfuscate kernel memory addresses
kernel.kptr_restrict = 1
# Restrict dmesg access
# This can leak specific harware failures to exploit
kernel.dmesg_restrict = 1

View file

@ -0,0 +1,39 @@
---
- name: Install certbot and nginx plugin
apt:
update_cache: true
name:
- certbot
- python3-certbot-nginx
register: pkg_result
retries: 3
until: pkg_result is succeeded
- name: Create /etc/letsencrypt/conf.d
file:
path: /etc/letsencrypt/conf.d
state: directory
mode: 0755
- name: Add Certbot configuration
template:
src: "letsencrypt/conf.d/certname.ini.j2"
dest: "/etc/letsencrypt/conf.d/{{ certbot.certname }}.ini"
mode: 0644
register: certbot_config
- name: Stop services to allow certbot to generate a cert.
service:
name: nginx
state: stopped
when: certbot_config.changed
- name: Generate new certificate if the configuration changed
shell: "certbot certonly --non-interactive --config /etc/letsencrypt/conf.d/{{ certbot.certname }}.ini"
when: certbot_config.changed
- name: Restart services to allow certbot to generate a cert.
service:
name: nginx
state: started
when: certbot_config.changed

View file

@ -0,0 +1,23 @@
# {{ ansible_managed }}
# Pour appliquer cette conf et générer la conf de renewal :
# certbot --config /etc/letsencrypt/conf.d/{{ certbot.certname }}.ini certonly
# Use a 4096 bit RSA key instead of 2048
rsa-key-size = 4096
# Always use the staging/testing server
# server = https://acme-staging.api.letsencrypt.org/directory
# Uncomment and update to register with the specified e-mail address
email = {{ certbot.mail }}
# Uncomment to use a text interface instead of ncurses
text = True
# Use nginx challenge
authenticator = nginx
# Wildcard the domain
cert-name = {{ certbot.certname }}
domains = {{ ", ".join(certbot.domains) }}

View file

@ -1,13 +0,0 @@
---
# Build front-end bundle
# This can take very long and requires > 2GB of RAM
- name: Build front-end for CodiMD
command: NODE_ENV="production" yarn run build
args:
chdir: /var/local/codimd/codimd
become: true
become_user: codimd
# Reload systemd daemons when a service file changes
- name: Reload systemd daemons
command: systemctl daemon-reload

View file

@ -1,28 +0,0 @@
---
# For NodeJS package
- name: Configure NodeJS pin
when:
- ansible_distribution == 'Debian'
- ansible_distribution_release == 'stretch'
template:
src: apt/nodejs.j2
dest: /etc/apt/preferences.d/nodejs
mode: 0644
# TODO
# apt-transport-https
# curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
# echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
# Install CodiMD dependencies
- name: Install required packages
apt:
name: "{{ item }}"
state: present
update_cache: true
with_items:
- git
- nodejs
- npm
- build-essential
- yarn

View file

@ -1,26 +0,0 @@
---
# Security #1
- name: Create CodiMD system group
group:
name: codimd
system: yes
state: present
# Security #2
- name: Create CodiMD user
user:
name: codimd
group: codimd
home: /var/local/codimd
comment: CodiMD
system: yes
state: present
# Security #3
- name: Secure CodiMD home directory
file:
path: /var/local/codimd
state: directory
owner: codimd
group: codimd
mode: 0750

View file

@ -1,59 +0,0 @@
---
# Install APT dependencies
- include_tasks: 0_apt_dependencies.yml
# Create CodiMD user and group
- include_tasks: 1_user_group.yml
# Download CodiMD
- name: Clone CodiMD project
git:
repo: https://github.com/hackmdio/codimd.git
dest: /var/local/codimd/codimd
version: 1.3.0
become: true
become_user: codimd
notify: Build front-end for CodiMD
# Setup dependencies and configs
- name: Install CodiMD depedencies
command: NODE_ENV="production" bin/setup
args:
chdir: /var/local/codimd/codimd
become: true
become_user: codimd
# Connection to database
- name: Connect CodiMD to PostgreSQL db
template:
src: sequelizerc.j2
dest: /var/local/codimd/codimd/.sequelizerc
owner: codimd
group: codimd
mode: 0600
# Configure
- name: Configure CodiMD
template:
src: config.json.j2
dest: /var/local/codimd/codimd/config.json
owner: codimd
group: codimd
mode: 0600
# Service file
- name: Install CodiMD systemd unit
template:
src: 'systemd/codimd.service.j2'
dest: '/etc/systemd/system/codimd.service'
owner: root
group: root
mode: 0644
notify: Reload systemd daemons
# Run
- name: Ensure that CodiMD is started
service:
name: codimd
state: started
enabled: true

View file

@ -1,39 +0,0 @@
{
"production": {
"domain": "codimd.auro.re",
"debug": false,
"port": 8080,
"useSSL": false,
"protocolUseSSL": true,
"useCDN": false,
"csp": {
"enable": true,
"directives": {
},
"upgradeInsecureRequests": "auto",
"addDefaults": true
},
"db": {
"username": "codimd",
"password": "{{ postgresql_codimd_passwd }}",
"database": "codimd",
"host": "{{ postgresql_services_url }}",
"port": "5432",
"dialect": "postgres"
},
"email": false,
"ldap": {
"url": "{{ ldap_master_uri }}",
"bindDn": "{{ ldap_codimd_bind_dn }}",
"bindCredentials": "{{ ldap_codimd_password }}",
"searchBase": "cn=Utilisateurs,dc=auro,dc=re",
"searchFilter": "(uid={% raw %}{{username}}{% endraw %})",
"searchAttributes": ["uid", "givenName", "mail"],
"usernameField": "uid",
"useridField": "uid",
"providerName": "Compte Aurore"
},
"allowFreeURL": true
}
}

View file

@ -1,8 +0,0 @@
var path = require('path');
module.exports = {
'config': path.resolve('config.json'),
'migrations-path': path.resolve('lib', 'migrations'),
'models-path': path.resolve('lib', 'models'),
'url': 'postgres://codimd:{{ postgresql_codimd_passwd }}@{{ postgresql_services_url }}:5432/codimd'
}

View file

@ -0,0 +1,58 @@
---
# Install HTTPS support for APT
- name: Install apt-transport-https
apt:
update_cache: true
name:
- apt-transport-https
- ca-certificates
- curl
- gnupg2
- software-properties-common
state: present
register: apt_result
retries: 3
until: apt_result is succeeded
# Add the key
- name: Configure the apt key
apt_key:
url: https://download.docker.com/linux/debian/gpg
id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
state: present
register: apt_key_result
retries: 3
until: apt_key_result is succeeded
# Add the repository into source list
- name: Configure docker repository
apt_repository:
repo: "{{ item }}"
state: present
loop:
- deb https://download.docker.com/linux/debian buster stable
- name: Install docker
apt:
update_cache: true
name:
- docker-ce
- docker-ce-cli
- containerd.io
state: present
register: apt_result
retries: 3
until: apt_result is succeeded
# Compose need to be updated to use new Docker features
- name: Install Docker Compose
get_url:
url: https://github.com/docker/compose/releases/download/1.24.1/docker-compose-Linux-x86_64
dest: /usr/local/bin/docker-compose
mode: "0755"
- name: Indicate role in motd
template:
src: update-motd.d/05-service.j2
dest: /etc/update-motd.d/05-docker
mode: 0755

View file

@ -0,0 +1,3 @@
#!/bin/sh
# {{ ansible_managed }}
echo "> Les recettes Docker-compose se trouvent dans /var/local/ansible-docker"

View file

@ -22,5 +22,9 @@
# Install
- name: Install DokuWiki
apt:
name: dokuwiki
update_cache: true
name: dokuwiki
state: present
register: apt_result
retries: 3
until: apt_result is succeeded

View file

@ -1,4 +0,0 @@
---
# Reload systemd daemons when a service file changes
- name: Reload systemd daemons
command: systemctl daemon-reload

View file

@ -1,26 +0,0 @@
---
# Security #1
- name: Create EtherPad system group
group:
name: etherpad
system: yes
state: present
# Security #2
- name: Create EtherPad user
user:
name: etherpad
group: etherpad
home: /var/local/etherpad
comment: EtherPad
system: yes
state: present
# Security #3
- name: Secure Etherpad home directory
file:
path: /var/local/etherpad
state: directory
owner: etherpad
group: etherpad
mode: 0750

View file

@ -1,59 +0,0 @@
---
# Install APT dependencies
- include_tasks: 0_apt_dependencies.yml
# Create EtherPad user and group
- include_tasks: 1_user_group.yml
# Download EtherPad
- name: Clone EtherPad project
git:
repo: https://github.com/ether/etherpad-lite.git
dest: /var/local/etherpad/etherpad-lite
version: master
become: true
become_user: etherpad
# Installation script
# TODO: move this in a handler
- name: Install Etherpad dependencies
command: bin/installDeps.sh
args:
chdir: /var/local/etherpad/etherpad-lite
become: true
become_user: etherpad
# Configuration
- name: Configure EtherPad
lineinfile:
dest: /var/local/etherpad/etherpad-lite/settings.json
regexp: '^\s*"{{ item.key }}"'
line: "{{ item.value }}"
with_dict:
title: " \"title\": \"Etherpad Aurore\","
dbType: " \"dbType\" : \"postgres\","
defaultPadText: " \"defaultPadText\" : \"Bienvenue sur l'EtherPad d'Aurore !\\n\\nCe pad est synchronisé avec les autres utilisateur·rice·s présent·e·s sur cette page.\\n\","
lang: " \"lang\": \"fr-fr\""
# Service file
- name: Install EtherPad systemd unit
template:
src: systemd/etherpad-lite.service.j2
dest: /etc/systemd/system/etherpad-lite.service
owner: root
group: root
mode: 0644
notify: Reload systemd daemons
# Run
- name: Ensure that EtherPad is started
service:
name: etherpad-lite
state: started
enabled: True
# La configuration de la clé `dbSettings` n'est pas encore automatisé !
# TODO-list
# * Configure admin user, logs
# Plugins : https://framacloud.org/fr/cultiver-son-jardin/etherpad.html#concernant-framapad

View file

@ -1,5 +0,0 @@
# {{ ansible_managed }}
Package: node* libuv1*
Pin: release a=stretch-backports
Pin-Priority: 600

View file

@ -1,17 +0,0 @@
# {{ ansible_managed }}
[Unit]
Description=Etherpad-lite, the collaborative editor.
After=syslog.target network-online.target mysql.service postgresql.service
Conflicts=shutdown.target
[Service]
Type=simple
User=etherpad
Group=etherpad
WorkingDirectory=/var/local/etherpad/etherpad-lite
ExecStart=/usr/bin/nodejs /var/local/etherpad/etherpad-lite/node_modules/ep_etherpad-lite/node/server.js
Restart=always
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,186 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFvRo7oBEADH/lEeQBaRW4Lpmzhpn7W53hhMUefgj1bJ7ISpMC3qOlgSIeof
sQjZ5Hr0RHxz5bRVRtcOhPhKRvL0wCmTpROvKBVyrOHDn4AAh+D7bqhzrEZezJwu
on2fBRA5prT97r99WKpIPjyqeKHWY3GsbkKMYAcFMGNwYZudEm9bqFaZ9F1CX96i
VHTArZiZZgPPycOW6fZzrdPDa5/07WA4tJ4PXnMFEd3bLpRDW/t46XqBeNOitBcN
TrRY7LY/rLnfAUfTWlQVm1wb5gl1E0e4LDlaAysqZCVDriAUwNzk9aRnLQw14h18
af3sIi649fQ/uv/JwQ9hc1os/gu23N4wKSwSvQGYo3V6oqbxkhIQ5TR0MgXIxfF9
LoSFgnrXvUpUc+V4qXJJV+hLbTEoAKrHaON0f7BQHAiTsKB1R7FLVCMFIRtuZ1RD
iUCL9jFFXmAikHsTUFE2EOCW7+kqRSQ5ICu3IqMbXXA1dHz4tN2ji5LPZ4OKh/1O
zZQCBev4IZ3KWibFZwNxDwWFSoFQeuNKnVujsfR31SuFRWmASqZGGpN/Jr+zVNsb
iUXUBrnSj8PXYs1zSLrfVVlaga6EI29o5ozUweZDvn5VnRycHaTVjVEmYynnf0ss
axkRKDgP4e0czNTbH9Rze+AL/Xfc5F0CVQ3jGZQwLgspqpj2UNicZhTzQwARAQAB
tCtEYXZpZCBMYW1wYXJ0ZXIgPGVxdWlub3gtZGViaWFuQGRpYWMyNC5uZXQ+iQJO
BBMBCAA4FiEEPZlorJrnvhFpKI3bH9WDmJX1f9oFAlvRo7oCGwEFCwkIBwIGFQgJ
CgsCBBYCAwECHgECF4AACgkQH9WDmJX1f9pNHg//VS3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XRU18jQz0AEQEAAYkCNgQYAQoAIBYhBKkPw22UKUCXmOnC2HTe
7UOrGU2/BQJclT6LAhsMAAoJEHTe7UOrGU2/kToP/il4dvWMMJS4pgXuDPcwTaYc
e8T9a8Uf0B2BOOKJgLZk2kvI21bwHnGxXc3zuUHCzZ81Y89/IpX+s37J+frvLbqd
xOfE39+5plK9BDn7G9UsTzg7mXuGWpMQA6Mvki4LslY/qCfUqzVeFPNZquH4Emxr
z1u0SldhaqctrkKwW1teTTmqbCtGrRpb0v8x42TBw+WvBJopelpgtdy3TnRbKk86
NkiiPFVRnfC0RjyMlLxa095t5s8irrqjnAAKMvwKiuzt97CQ/U68WbsOYLyv42PT
ClfbbFJw6ghTZ7SRxiGwUVz7EwQ31MsiffmyJKRca81yqSQfrPS4MkEXChZBt8wF
C1IhG9I9zbHKt9saXWPYCbL8Zs2x3c1md62dl4mrH/VwLV9T+7PaJCM8qrFtkWlu
cYntgBhLW1KY9dWkCtZ7ML70n8FyIyHMD35mZb3lw+c1dBusuwGwZLSksH9ucOQz
Zh3+rlZ8PkYXXosKTkp9qBDVoSgNU5AH8F+K/Uw1uVm+JqqFP/ieQQydS8wAVYAv
ax/ZP+wTHhLvmHUoI70K51osk+sLcFh+h9L6sK+kq9i2mrJs/d2Sk6jau96RJCFe
pHI+29yZoK5ZpOkvFAFvbNXMFd2sn5O60y9LAvr9u2QRNlTvmQ7B1o2/US62SoD4
HGxIKIAggOUujclydhvu
=+/L/
-----END PGP PUBLIC KEY BLOCK-----

View file

@ -0,0 +1,5 @@
---
- name: restart frr
service:
name: frr
state: restarted

View file

@ -0,0 +1,39 @@
---
- name: install GPG
apt:
name: gnupg
- name: Add FRR repo key
apt_key:
data: "{{ lookup('file', 'frr-apt-key.asc') }}"
state: present
- name: Add FRR apt repository
apt_repository:
repo: deb https://deb.frrouting.org/frr buster frr-stable
state: present
notify: restart frr
- name: Install frr
apt:
name: frr
- name: setup frr daemons
template:
src: daemons.j2
dest: /etc/frr/daemons
mode: 0644
notify: restart frr
- name: setup frr.conf
template:
src: frr.conf.j2
dest: /etc/frr/frr.conf
mode: 0644
notify: restart frr
- name: enable+start frr
service:
name: frr
state: started
enabled: true

View file

@ -0,0 +1,67 @@
# This file tells the frr package which daemons to start.
#
# Sample configurations for these daemons can be found in
# /usr/share/doc/frr/examples/.
#
# ATTENTION:
#
# When activation a daemon at the first time, a config file, even if it is
# empty, has to be present *and* be owned by the user and group "frr", else
# the daemon will not be started by /etc/init.d/frr. The permissions should
# be u=rw,g=r,o=.
# When using "vtysh" such a config file is also needed. It should be owned by
# group "frrvty" and set to ug=rw,o= though. Check /etc/pam.d/frr, too.
#
# The watchfrr and zebra daemons are always started.
#
{% if 'backup' in inventory_hostname %}
bgpd=no
{% else %}
bgpd=yes
{% endif %}
ospfd=no
ospf6d=no
ripd=no
ripngd=no
isisd=no
pimd=no
ldpd=no
nhrpd=no
eigrpd=no
babeld=no
sharpd=no
pbrd=no
bfdd=no
#
# If this option is set the /etc/init.d/frr script automatically loads
# the config via "vtysh -b" when the servers are started.
# Check /etc/pam.d/frr if you intend to use "vtysh"!
#
vtysh_enable=yes
zebra_options=" -A 127.0.0.1 -s 90000000"
bgpd_options=" -A 127.0.0.1"
ospfd_options=" -A 127.0.0.1"
ospf6d_options=" -A ::1"
ripd_options=" -A 127.0.0.1"
ripngd_options=" -A ::1"
isisd_options=" -A 127.0.0.1"
pimd_options=" -A 127.0.0.1"
ldpd_options=" -A 127.0.0.1"
nhrpd_options=" -A 127.0.0.1"
eigrpd_options=" -A 127.0.0.1"
babeld_options=" -A 127.0.0.1"
sharpd_options=" -A 127.0.0.1"
pbrd_options=" -A 127.0.0.1"
staticd_options="-A 127.0.0.1"
bfdd_options=" -A 127.0.0.1"
# The list of daemons to watch is automatically generated by the init script.
#watchfrr_options=""
# for debugging purposes, you can specify a "wrap" command to start instead
# of starting the daemon directly, e.g. to use valgrind on ospfd:
# ospfd_wrap="/usr/bin/valgrind"
# or you can use "all_wrap" for all daemons, e.g. to use perf record:
# all_wrap="/usr/bin/perf record --call-graph -"
# the normal daemon command is added to this at the end.

View file

@ -0,0 +1,24 @@
log syslog informational
log stdout
hostname routeur-aurore
password Tux
enable password Tux
interface lo
line vty
# Aurore AS.
router bgp 43619
#no synchronization
bgp router-id 45.66.111.254
# Remote-AS: Zayo.
neighbor 2001:1b48:2:103::d7:1 remote-as 8218
address-family ipv6
network 2a09:6840::/29
neighbor 2001:1b48:2:103::d7:1 activate
exit-address-family
!

View file

@ -0,0 +1,14 @@
---
- name: force run dhcp re2o-service
shell: /var/local/re2o-services/dhcp/main.py --force
become_user: re2o-services
- name: restart dhcpd
systemd:
state: restarted
name: isc-dhcp-server
- name: restart rsyslog
systemd:
name: rsyslog
state: restarted

View file

@ -0,0 +1,110 @@
---
- name: Install dhcp (re2o-service)
import_role:
name: re2o-service
vars:
service_repo: https://gitlab.federez.net/re2o/dhcp.git
service_name: dhcp
service_version: master
service_config:
hostname: re2o.auro.re
username: service-user
password: "{{ vault_serviceuser_passwd }}"
- name: Ensure appropriate permissions on dhcp re2o service
file:
path: /var/local/re2o-services/dhcp/
state: directory
owner: re2o-services
group: nogroup
recurse: yes
- name: Install isc-dhcp-server
apt:
update_cache: true
name: isc-dhcp-server
state: present
register: apt_result
retries: 3
until: apt_result is succeeded
notify: restart dhcpd
- name: Ensure dhcp log directory exists
file:
path: /var/log/dhcp
owner: root
group: root
mode: u=rwx,g=rx,a=rx
state: directory
- name: Ensure rsyslog knows where to send dhcp logs
lineinfile:
path: /etc/rsyslog.conf
line: "local7.* /var/log/dhcp/dhcpd.log"
notify: restart rsyslog
- name: Configure dhcp log rotation
template:
src: logrotate.d/dhcp.j2
dest: /etc/logrotate.d/dhcp
mode: 0644
- name: set up cron to reload dhcp re2o service
cron:
# Do not change this name or idempotence *might* be lost.
name: dhcp-re2o-service
cron_file: re2o-services
minute: "*/2"
hour: "*"
day: "*"
weekday: "*"
month: "*"
user: root
job: "/usr/bin/python3 /var/local/re2o-services/dhcp/main.py"
- name: Configure /etc/default/isc-dhcp-server
template:
src: default/isc-dhcp-server.j2
dest: /etc/default/isc-dhcp-server
mode: 0644
notify: restart dhcpd
- name: Configure dhcp-failover.conf
template:
src: dhcp/dhcp-failover.conf.j2
dest: /etc/dhcp/dhcp-failover.conf
mode: 0600
when: dhcp_failover_enabled
notify: restart dhcpd
- name: Configure dhcpd.conf
template:
src: dhcp/dhcpd.conf.j2
dest: /etc/dhcp/dhcpd.conf
mode: 0600
notify: restart dhcpd
- name: Configure subnets.conf (regular service)
template:
src: dhcp/regular-subnets.conf.j2
dest: /etc/dhcp/subnets.conf
mode: 0600
notify: restart dhcpd
when: not is_aurore_host
- name: Configure subnets.conf (aurore service)
template:
src: dhcp/aurore-subnets.conf.j2
dest: /etc/dhcp/subnets.conf
mode: 0600
notify: restart dhcpd
when: is_aurore_host
- name: force run dhcp re2o-service
shell: /var/local/re2o-services/dhcp/main.py --force
- name: Ensure dhcpd is running
service:
name: isc-dhcp-server
state: started
enabled: true

View file

@ -0,0 +1,24 @@
# Defaults for isc-dhcp-server (sourced by /etc/init.d/isc-dhcp-server)
# Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf).
#DHCPDv4_CONF=/etc/dhcp/dhcpd.conf
#DHCPDv6_CONF=/etc/dhcp/dhcpd6.conf
# Path to dhcpd's PID file (default: /var/run/dhcpd.pid).
#DHCPDv4_PID=/var/run/dhcpd.pid
#DHCPDv6_PID=/var/run/dhcpd6.pid
# Additional options to start dhcpd with.
# Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead
#OPTIONS=""
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
{% if is_aurore_host %}
INTERFACESv4="ens19"
INTERFACESv6=""
{% else %}
INTERFACESv4="ens19 ens20 ens21 ens22 ens23"
INTERFACESv6=""
{% endif %}

View file

@ -0,0 +1,12 @@
subnet 45.66.110.0 netmask 255.255.255.0 {
interface "ens19";
option subnet-mask 255.255.255.0;
option broadcast-address 45.66.110.255;
option routers 45.66.110.{{ router_ip_suffix }};
option domain-name-servers 45.66.110.{{ dns_host_suffix_main }}, {{ backup_dns_servers|join(', ') }};
option domain-name "adh.auro.re";
option domain-search "adh.auro.re";
include "/var/local/re2o-services/dhcp/generated/dhcp.adh.auro.re.list";
deny unknown-clients;
}

View file

@ -0,0 +1,31 @@
failover peer "dhcp-failover" {
{% if inventory_hostname == dhcp_failover.primary_host %}
primary;
# MCLT = Maximum Client Lead Time.
# Must be specified on the primary, forbidden on the secondary.
mclt 3600;
# Address or DNS name on which this node listens for connections
# from its failover peer.
address {{ dhcp_failover.primary_host }};
peer address {{ dhcp_failover.secondary_host }};
# Load balancing.
split 128;
{% endif %}
{% if inventory_hostname == dhcp_failover.secondary_host %}
secondary;
# Address and peer address are reversed on the secondary node.
address {{ dhcp_failover.secondary_host }};
peer address {{ dhcp_failover.primary_host }};
{% endif %}
# The following options can be shared between primary and
# secondary failover peers.
port 647;
peer port 647;
max-response-delay 30;
max-unacked-updates 10;
load balance max seconds 3;
}

View file

@ -0,0 +1,25 @@
default-lease-time 86400;
max-lease-time 86400;
# Option definitions common to all supported networks.
option interface-mtu {{ mtu }};
option root-path "/";
# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
ddns-update-style none;
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
authoritative;
log-facility local7;
{% if dhcp_failover_enabled %}
include "/etc/dhcp/dhcp-failover.conf";
{% endif %}
include "/etc/dhcp/subnets.conf";

View file

@ -0,0 +1,94 @@
# Bornes WiFi
subnet 10.{{ subnet_ids.ap }}.0.0 netmask 255.255.0.0 {
interface "ens19";
option subnet-mask 255.255.0.0;
option broadcast-address 10.{{ subnet_ids.ap }}.255.255;
option routers 10.{{ subnet_ids.ap }}.0.250;
option domain-name "borne.auro.re";
option domain-search "borne.auro.re";
option domain-name-servers 10.{{ subnet_ids.ap }}.0.{{ dns_host_suffix_main }}, 10.{{ subnet_ids.ap }}.0.{{ dns_host_suffix_backup }}, {{ backup_dns_servers|join(', ') }};
include "/var/local/re2o-services/dhcp/generated/dhcp.borne.auro.re.list";
deny unknown-clients;
}
# Users filaire
subnet 10.{{ subnet_ids.users_wired }}.0.0 netmask 255.255.0.0 {
interface "ens20";
option subnet-mask 255.255.0.0;
option broadcast-address 10.{{ subnet_ids.users_wired }}.255.255;
option routers 10.{{ subnet_ids.users_wired }}.0.{{ router_ip_suffix }};
option domain-name "fil.{{ apartment_block_dhcp }}.auro.re";
option domain-search "auro.re";
option domain-name-servers 10.{{ subnet_ids.users_wired }}.0.{{ dns_host_suffix_main }}, 10.{{ subnet_ids.users_wired }}.0.{{ dns_host_suffix_backup }}, {{ backup_dns_servers|join(', ') }};
include "/var/local/re2o-services/dhcp/generated/dhcp.fil.{{ apartment_block_dhcp }}.auro.re.list";
deny unknown-clients;
}
# Users WiFi
subnet 10.{{ subnet_ids.users_wifi }}.0.0 netmask 255.255.0.0 {
interface "ens21";
option subnet-mask 255.255.0.0;
option broadcast-address 10.{{ subnet_ids.users_wifi }}.255.255;
option routers 10.{{ subnet_ids.users_wifi }}.0.{{ router_ip_suffix }};
option domain-name "wifi.{{ apartment_block_dhcp }}.auro.re";
option domain-search "auro.re";
option domain-name-servers 10.{{ subnet_ids.users_wifi }}.0.{{ dns_host_suffix_main }}, 10.{{ subnet_ids.users_wifi }}.0.{{ dns_host_suffix_backup }}, {{ backup_dns_servers|join(', ') }};
include "/var/local/re2o-services/dhcp/generated/dhcp.wifi.{{ apartment_block_dhcp }}.auro.re.list";
pool {
range 10.{{ subnet_ids.users_wifi }}.8.0 10.{{ subnet_ids.users_wifi }}.10.255;
{% if dhcp_failover is defined %}
failover peer "dhcp-failover";
{% endif %}
}
}
# Banni
subnet 10.{{ subnet_ids.users_banni }}.0.0 netmask 255.255.0.0 {
interface "ens22";
option subnet-mask 255.255.0.0;
option broadcast-address 10.{{ subnet_ids.users_banni }}.255.255;
option routers 10.{{ subnet_ids.users_banni }}.0.{{ router_ip_suffix }};
option domain-name "banni.{{ apartment_block_dhcp }}.auro.re";
option domain-search "auro.re";
option domain-name-servers 10.{{ subnet_ids.users_banni }}.0.{{ dns_host_suffix_main }}, 10.{{ subnet_ids.users_banni }}.0.{{ dns_host_suffix_backup }};
pool {
range 10.{{ subnet_ids.users_banni }}.1.0 10.{{ subnet_ids.users_banni }}.2.255;
{% if dhcp_failover is defined %}
failover peer "dhcp-failover";
{% endif %}
}
}
# Accueil
subnet 10.{{ subnet_ids.users_accueil }}.0.0 netmask 255.255.0.0 {
interface "ens23";
option subnet-mask 255.255.0.0;
option broadcast-address 10.{{ subnet_ids.users_accueil }}.255.255;
option routers 10.{{ subnet_ids.users_accueil }}.0.{{ router_ip_suffix }};
option domain-name "accueil.{{ apartment_block_dhcp }}.auro.re";
option domain-search "auro.re";
option domain-name-servers 10.{{ subnet_ids.users_accueil }}.0.{{ dns_host_suffix_main }}, 10.{{ subnet_ids.users_accueil }}.0.{{ dns_host_suffix_backup }};
pool {
range 10.{{ subnet_ids.users_accueil }}.1.0 10.{{ subnet_ids.users_accueil }}.2.255;
{% if dhcp_failover is defined %}
failover peer "dhcp-failover";
{% endif %}
}
}

View file

@ -0,0 +1,11 @@
/var/log/dhcp/dhcpd.log {
# common options
daily
rotate 365
missingok
compress
delaycompress
notifempty
copytruncate
}

View file

@ -0,0 +1,4 @@
---
dhcp_failover:
primary_host: dhcp-{{ apartment_block }}.adm.auro.re
secondary_host: dhcp-{{ apartment_block }}-backup.adm.auro.re

View file

@ -1,40 +0,0 @@
---
# Install LDAP client packages
- name: Install LDAP client packages
apt:
name: "{{ item }}"
state: present
update_cache: true
with_items:
- nslcd
- libnss-ldapd
- libpam-ldapd
# Reduce LDAP load
# For the moment it is broken on Stretch when using PHP7.3
# - name: Install LDAP cache package
# apt:
# name: nscd
# state: present
# update_cache: true
# Configure /etc/nslcd.conf
- name: Configure nslcd LDAP credentials
template:
src: nslcd.conf.j2
dest: /etc/nslcd.conf
mode: 0600
notify: Restart nslcd service
# Configure /etc/nsswitch.conf
- name: Configure NSS to use LDAP
lineinfile:
dest: /etc/nsswitch.conf
regexp: "^{{ item.key }}:"
line: "{{ item.value }}"
with_dict:
passwd: 'passwd: files ldap'
group: 'group: files ldap'
shadow: 'shadow: files ldap'
sudoers: 'sudoers: files ldap'
notify: Restart nslcd service

View file

@ -1,20 +0,0 @@
---
# Filter SSH on groups
- name: Filter SSH on groups
lineinfile:
dest: /etc/ssh/sshd_config
regexp: '^AllowGroups'
line: "AllowGroups root sudoldap aurore ssh"
# To gain root access with ldap rights
- name: Install SUDO package
package:
name: sudo
state: present
# Set sudo group
- name: Configure sudoers
lineinfile:
dest: /etc/sudoers
regexp: "^%{{ sudo_group }}"
line: "%{{ sudo_group }} ALL=(ALL:ALL) ALL"

View file

@ -1,38 +0,0 @@
# {{ ansible_managed }}
# The user and group nslcd should run as.
uid nslcd
gid nslcd
# The location at which the LDAP server(s) should be reachable.
{% if ldap_local_replica_uri is defined %}
{% for uri in ldap_local_replica_uri %}
uri {{ uri }}
{% endfor %}
{% endif %}
uri {{ ldap_master_uri }}
# The search base that will be used for all queries.
base {{ ldap_base }}
base passwd cn=Utilisateurs,{{ ldap_base }}
base shadow cn=Utilisateurs,{{ ldap_base }}
base group ou=posix,ou=groups,{{ ldap_base }}
# The LDAP protocol version to use.
ldap_version 3
# The DN to bind with for normal lookups.
binddn {{ ldap_nslcd_bind_dn }}
bindpw {{ ldap_nslcd_passwd }}
# The DN used for password modifications by root.
#rootpwmoddn cn=admin,dc=example,dc=com
# SSL options
#ssl off
#tls_reqcert never
tls_cacertfile /etc/ssl/certs/ca-certificates.crt
# The search scope.
#scope sub

View file

@ -1,6 +1,6 @@
---
- name: Reconfigure libnss-ldapd package
command: 'dpkg-reconfigure libnss-ldapd -f noninteractive'
command: dpkg-reconfigure libnss-ldapd -f noninteractive
- name: Restart nslcd service
service:

View file

@ -0,0 +1,37 @@
---
# Filter SSH on groups
- name: Filter SSH on groups
when: ansible_facts['hostname'] != "camelot" # Camelot is accessible for everyone
lineinfile:
dest: /etc/ssh/sshd_config
regexp: ^AllowGroups
line: AllowGroups root sudoldap aurore ssh
state: present
# To gain root access with ldap rights
- name: Install SUDO package
package:
name: sudo
state: present
register: package_result
retries: 3
until: package_result is succeeded
# Set sudo group
- name: Configure sudoers sudo group
lineinfile:
dest: /etc/sudoers
regexp: ^%{{ sudo_group }}
line: "%{{ sudo_group }} ALL=(ALL:ALL) ALL"
state: present
validate: /usr/sbin/visudo -cf %s
# Set sudo location group
- name: Configure sudoers sudo location group
lineinfile:
dest: /etc/sudoers
regexp: ^%{{ sudo_group_location }}
line: "%{{ sudo_group_location }} ALL=(ALL:ALL) ALL"
state: present
validate: /usr/sbin/visudo -cf %s
when: sudo_group_location is defined

View file

@ -3,9 +3,9 @@
- name: Copy passwd and chsh scripts
template:
src: "{{ item }}.j2"
dest: "/usr/local/bin/{{ item }}"
dest: /usr/local/bin/{{ item }}
mode: 0755
with_items:
loop:
- chsh
- passwd

View file

@ -0,0 +1,34 @@
---
# Install LDAP client packages
- name: Install LDAP client packages
apt:
update_cache: true
name:
- nslcd
- libnss-ldapd
- libpam-ldapd
- nscd # local cache
state: present
register: apt_result
retries: 3
until: apt_result is succeeded
# Configure /etc/nslcd.conf
- name: Configure nslcd LDAP credentials
template:
src: nslcd.conf.j2
dest: /etc/nslcd.conf
mode: 0600
notify: Restart nslcd service
# Configure /etc/nsswitch.conf
- name: Configure NSS to use LDAP
lineinfile:
dest: /etc/nsswitch.conf
regexp: "^{{ item }}:"
line: "{{ item }}: files ldap systemd"
loop:
- passwd
- group
- shadow
notify: Restart nslcd service

View file

@ -1,6 +1,6 @@
---
# Install and configure main LDAP tools
- include_tasks: 0_install_ldap.yml
- include_tasks: install_ldap.yml
# Filter who can access server and sudo on groups
- include_tasks: 1_group_security.yml

View file

@ -0,0 +1,62 @@
# {{ ansible_managed }}
# The user and group nslcd should run as.
uid nslcd
gid nslcd
# The location at which the LDAP server(s) should be reachable.
{% if 'fleming_vm' in group_names or 'fleming_pve' in group_names %}
{% for uri in groups['ldap_replica_fleming'] %}
uri ldap://{{ uri }}
{% endfor %}
{% endif %}
{% if 'rives_vm' in group_names or 'rives_pve' in group_names %}
{% for uri in groups['ldap_replica_rives'] %}
uri ldap://{{ uri }}
{% endfor %}
{% endif %}
{% if 'pacaterie_vm' in group_names or 'pacaterie_pve' in group_names %}
{% for uri in groups['ldap_replica_pacaterie'] %}
uri ldap://{{ uri }}
{% endfor %}
{% endif %}
{% if 'edc_vm' in group_names or 'edc_pve' in group_names or 'edc_server' in group_names %}
{% for uri in groups['ldap_replica_edc'] %}
uri ldap://{{ uri }}
{% endfor %}
{% endif %}
{% if 'gs_vm' in group_names or 'gs_pve' in group_names %}
{% for uri in groups['ldap_replica_gs'] %}
uri ldap://{{ uri }}
{% endfor %}
{% endif %}
{% if 'ovh_vm' in group_names or 'ovh_container' in group_names or 'ovh_pve' in group_names %}
{% for uri in groups['ldap_replica_ovh'] %}
uri ldap://{{ uri }}
{% endfor %}
{% endif %}
uri {{ ldap_master_uri }}
# The search base that will be used for all queries.
base {{ ldap_base }}
base passwd cn=Utilisateurs,{{ ldap_base }}
base shadow cn=Utilisateurs,{{ ldap_base }}
base group ou=posix,ou=groups,{{ ldap_base }}
# The LDAP protocol version to use.
ldap_version 3
# The DN to bind with for normal lookups.
binddn {{ ldap_nslcd_bind_dn }}
bindpw {{ ldap_nslcd_passwd }}
# The DN used for password modifications by root.
#rootpwmoddn cn=admin,dc=example,dc=com
# SSL options
#ssl off
#tls_reqcert never
tls_cacertfile /etc/ssl/certs/ca-certificates.crt
# The search scope.
#scope sub

View file

@ -5,6 +5,9 @@
name: slapd
state: present
update_cache: true
register: apt_result
retries: 3
until: apt_result is succeeded
# What is written after is really not a nice way to install a schema
# because the LDAP is being flushed away always...
@ -25,22 +28,27 @@
# Cry a bit
- name: Remove old data
file: path={{ item }} state=absent
with_items:
file:
path: "{{ item }}"
state: absent
loop:
- /etc/ldap/slapd.d
- /var/lib/ldap
# Cry a lot
- name: Recreate structure
file: path={{ item }} state=directory
with_items:
file:
path: "{{ item }}"
state: directory
mode: 0755
loop:
- /etc/ldap/slapd.d
- /var/lib/ldap
# Install schema as root
# We can't do a `become_user` here
- name: Install LDAP schema
command: 'slapadd -n 0 -l /etc/ldap/schema.ldiff -F /etc/ldap/slapd.d'
command: slapadd -n 0 -l /etc/ldap/schema.ldiff -F /etc/ldap/slapd.d
# then fix permissions
- name: Fix permissions
@ -48,11 +56,13 @@
path: "{{ item }}"
owner: openldap
group: openldap
recurse: yes
with_items:
- '/var/lib/ldap'
- '/etc/ldap/slapd.d'
recurse: true
loop:
- /var/lib/ldap
- /etc/ldap/slapd.d
# Save the day
- name: Start LDAP server
service: name=slapd state=started
service:
name: slapd
state: started

View file

@ -1,6 +0,0 @@
---
# Restart mxisd when configuration changes
- name: Restart mxisd service
service:
name: mxisd
state: restarted

View file

@ -1,12 +0,0 @@
---
- name: Install mxisd
apt:
deb: https://github.com/kamax-matrix/mxisd/releases/download/v{{ mxisd_version }}/mxisd_{{ mxisd_version }}_all.deb
- name: Configure mxisd
template:
src: mxisd/mxisd.yaml.j2
dest: /etc/mxisd/mxisd.yaml
mode: 0600
owner: mxisd
notify: Restart mxisd service

View file

@ -1,89 +0,0 @@
# {{ ansible_managed }}
#######################
# Matrix config items #
#######################
# Matrix domain, same as 'server_name' in synapse configuration.
matrix:
domain: 'auro.re'
################
# Signing keys #
################
# Absolute path for the Identity Server signing keys database.
# /!\ THIS MUST **NOT** BE YOUR HOMESERVER KEYS FILE /!\
# If this path does not exist, it will be auto-generated.
key:
path: '/var/lib/mxisd/keys'
# Path to the SQLite DB file for mxisd internal storage
# /!\ THIS MUST **NOT** BE YOUR HOMESERVER DATABASE /!\
storage:
provider:
sqlite:
database: '/var/lib/mxisd/store.db'
###################
# Identity Stores #
###################
ldap:
enabled: true
connection:
host: '{{ ldap_master_ipv4 }}'
port: 389
bindDn: '{{ ldap_matrix_bind_dn }}'
bindPassword: '{{ ldap_matrix_password }}'
baseDNs:
- '{{ ldap_user_tree }}'
attribute:
uid:
type: 'uid'
value: 'uid'
name: 'uid'
#################################################
# Notifications for invites/addition to profile #
#################################################
# This is mandatory to deal with anything e-mail related.
#
# For an introduction to sessions, invites and 3PIDs in general,
# see https://github.com/kamax-matrix/mxisd/blob/master/docs/threepids/session/session.md#3pid-sessions
#
# If you would like to change the content of the notifications,
# see https://github.com/kamax-matrix/mxisd/blob/master/docs/threepids/notification/template-generator.md
#
#### E-mail connector
threepid:
medium:
email:
identity:
# The e-mail to send as.
from: "matrix@auro.re"
connectors:
smtp:
# SMTP host
host: "smtp.crans.org"
# SMTP port
port: 587
# STARTLS mode for the connection.
# SSL/TLS is currently not supported. See https://github.com/kamax-matrix/mxisd/issues/125
#
# Possible values:
# 0 Disable any kind of TLS entirely
# 1 Enable STARTLS if supported by server (default)
# 2 Force STARTLS and fail if not available
#
tls: 1
# Login for SMTP
login: "matrix@auro.re"
# Password for the account
password: ""

View file

@ -1,6 +0,0 @@
---
# Reload the NGINX service
- name: Reload NGINX service
service:
name: nginx
state: reloaded

View file

@ -1,51 +0,0 @@
---
# Install HTTPS support for APT
- name: Install apt-transport-https
apt:
name: apt-transport-https
update_cache: true
# Add the repository into source list
- name: Configure riot repository
apt_repository:
repo: "deb https://riot.im/packages/debian/ {{ ansible_distribution_release }} main"
# Add the key
- name: Configure the apt key
apt_key:
url: https://riot.im/packages/debian/repo-key.asc
id: E019645248E8F4A1
# Install riot
- name: Install riot-web
apt:
name: riot-web
update_cache: true
# Install nginx
- name: Install nginx
apt:
name: nginx
# Configure nginx
- name: Configure nginx
template:
src: nginx-riot.j2
dest: /etc/nginx/sites-available/riot
mode: 0644
notify: Reload NGINX service
# Desactive useless nginx sites
- name: Deactivate the default NGINX site
file:
path: /etc/nginx/sites-enabled/default
state: absent
notify: Reload NGINX service
# Activate sites
- name: Activate sites
file:
src: /etc/nginx/sites-available/riot
dest: /etc/nginx/sites-enabled/riot
state: link
notify: Reload NGINX service

View file

@ -1,20 +0,0 @@
# {{ ansible_managed }}
server {
listen 80;
listen [::]:80;
root /opt/Riot/resources/webapp/;
index index.html;
access_log /var/log/nginx/riot-access.log;
error_log /var/log/nginx/riot-errors.log;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Frame-Options "SAMEORIGIN" always;
location / {
try_files $uri $uri/ =404;
}
}

View file

@ -1,5 +0,0 @@
# {{ ansible_managed }}
password_providers:
- module: "rest_auth_provider.RestAuthProvider"
config:
endpoint: "http://127.0.0.1:8090"

View file

@ -0,0 +1,15 @@
---
# service_name is the name of the project on GitHub
service_name: matrix-appservice-irc
# URL to clone
service_repo: https://github.com/matrix-org/matrix-appservice-irc.git
# name of the service user
# It means that you will have to `sudo -u THISUSER zsh` to debug
service_user: "{{ service_name }}"
service_homedir: "/var/local/{{ service_name }}"
# service_path is where the project is cloned
# It can't be the home directory because of user hidden files.
service_path: "{{ service_homedir }}/{{ service_name }}"

View file

@ -0,0 +1,60 @@
---
# Create service user
- include_tasks: service_user.yml
- name: "Clone {{ service_name }} project"
git:
repo: "{{ service_repo }}"
dest: "{{ service_path }}"
version: 0.11.2
become: true
become_user: "{{ service_user }}"
# Setup dependencies
- name: "Install {{ service_name }} dependencies"
npm:
path: "{{ service_path }}"
production: true
become: true
become_user: "{{ service_user }}"
register: npm_result
retries: 3
until: npm_result is succeeded
- name: "Configure {{ service_name }}"
template:
src: config.yaml.j2
dest: "{{ service_path }}/config.yaml"
owner: "{{ service_user }}"
group: nogroup
mode: 0600
# Service file
- name: "Install {{ service_name }} systemd unit"
template:
src: systemd/appservice.service.j2
dest: "/etc/systemd/system/{{ service_name }}.service"
owner: root
group: root
mode: 0644
# TODO generate registration
# node app.js -r -f irc-registration.yaml \
# -u "http://localhost:9999" -c config.yaml -l ircbot
- name: Copy appservice registration file
copy:
src: "{{ service_path }}/irc-registration.yaml"
dest: "/etc/matrix-synapse/{{ service_name }}-registration.yaml"
owner: matrix-synapse
group: nogroup
mode: 0600
remote_src: true
# Run
- name: "Ensure that {{ service_name }} is started"
systemd:
name: "{{ service_name }}"
state: started
enabled: true
daemon_reload: true

View file

@ -0,0 +1,19 @@
---
# Having a custom group is useless so use nogroup
- name: "Create {{ service_user }} user"
user:
name: "{{ service_user }}"
group: nogroup
home: "{{ service_homedir }}"
system: true
shell: /bin/false
state: present
# Only service user should be able to go there
- name: "Secure {{ service_user }} home directory"
file:
path: "{{ service_homedir }}"
state: directory
owner: "{{ service_user }}"
group: nogroup
mode: 0700

View file

@ -0,0 +1,431 @@
# {{ ansible_managed }}
homeserver:
# The URL to the home server for client-server API calls, also used to form the
# media URLs as displayed in bridged IRC channels:
url: "http://auro.re"
#
# The URL of the homeserver hosting media files. This is only used to transform
# mxc URIs to http URIs when bridging m.room.[file|image] events. Optional. By
# default, this is the homeserver URL, specified above.
#
media_url: "https://auro.re"
# Drop Matrix messages which are older than this number of seconds, according to
# the event's origin_server_ts.
# If the bridge is down for a while, the homeserver will attempt to send all missed
# events on reconnection. These events may be hours old, which can be confusing to
# IRC users if they are then bridged. This option allows these old messages to be
# dropped.
# CAUTION: This is a very coarse heuristic. Federated homeservers may have different
# clock times and hence produce different origin_server_ts values, which may be old
# enough to cause *all* events from the homeserver to be dropped.
# Default: 0 (don't ever drop)
dropMatrixMessagesAfterSecs: 300 # 5 minutes
# The 'domain' part for user IDs on this home server. Usually (but not always)
# is the "domain name" part of the HS URL.
domain: "auro.re"
# Should presence be enabled for matrix clients on this bridge. If disabled on the
# homeserver then it should also be disabled here to avoid excess traffic.
# Default: true
enablePresence: true
# Configuration specific to the IRC service
ircService:
servers:
# The address of the server to connect to.
irc.crans.org:
# A human-readable short name. This is used to label IRC status rooms
# where matrix users control their connections.
# E.g. 'ExampleNet IRC Bridge status'.
# It is also used in the Third Party Lookup API as the instance `desc`
# property, where each server is an instance.
name: "Crans IRC Bridge status"
additionalAddresses: [ ]
#
# [DEPRECATED] Use `name`, above, instead.
# A human-readable description string
# description: "Example.com IRC network"
# An ID for uniquely identifying this server amongst other servers being bridged.
networkId: "crans"
# URL to an icon used as the network icon whenever this network appear in
# a network list. (Like in the riot room directory, for instance.)
# icon: https://example.com/images/hash.png
# The port to connect to. Optional.
port: 6697
# Whether to use SSL or not. Default: false.
ssl: true
# Whether or not IRC server is using a self-signed cert or not providing CA Chain
sslselfsign: true
# Should the connection attempt to identify via SASL (if a server or user password is given)
# If false, this will use PASS instead. If SASL fails, we do not fallback to PASS.
sasl: false
# Whether to allow expired certs when connecting to the IRC server.
# Usually this should be off. Default: false.
allowExpiredCerts: false
# A specific CA to trust instead of the default CAs. Optional.
#ca: |
# -----BEGIN CERTIFICATE-----
# ...
# -----END CERTIFICATE-----
#
# The connection password to send for all clients as a PASS (or SASL, if enabled above) command. Optional.
# password: 'pa$$w0rd'
#
# Whether or not to send connection/error notices to real Matrix users. Default: true.
sendConnectionMessages: true
quitDebounce:
# Whether parts due to net-splits are debounced for delayMs, to allow
# time for the netsplit to resolve itself. A netsplit is detected as being
# a QUIT rate higher than quitsPerSecond. Default: false.
enabled: false
# The maximum number of quits per second acceptable above which a netsplit is
# considered ongoing. Default: 5.
quitsPerSecond: 5
# The time window in which to wait before bridging a QUIT to Matrix that occurred during
# a netsplit. Debouncing is jittered randomly between delayMinMs and delayMaxMs so that the HS
# is not sent many requests to leave rooms all at once if a netsplit occurs and many
# people to not rejoin.
# If the user with the same IRC nick as the one who sent the quit rejoins a channel
# they are considered back online and the quit is not bridged, so long as the rejoin
# occurs before the randomly-jittered timeout is not reached.
# Default: 3600000, = 1h
delayMinMs: 3600000 # 1h
# Default: 7200000, = 2h
delayMaxMs: 7200000 # 2h
# A map for conversion of IRC user modes to Matrix power levels. This enables bridging
# of IRC ops to Matrix power levels only, it does not enable the reverse. If a user has
# been given multiple modes, the one that maps to the highest power level will be used.
modePowerMap:
o: 50
botConfig:
# Enable the presence of the bot in IRC channels. The bot serves as the entity
# which maps from IRC -> Matrix. You can disable the bot entirely which
# means IRC -> Matrix chat will be shared by active "M-Nick" connections
# in the room. If there are no users in the room (or if there are users
# but their connections are not on IRC) then nothing will be bridged to
# Matrix. If you're concerned about the bot being treated as a "logger"
# entity, then you may want to disable the bot. If you want IRC->Matrix
# but don't want to have TCP connections to IRC unless a Matrix user speaks
# (because your client connection limit is low), then you may want to keep
# the bot enabled. Default: true.
# NB: If the bot is disabled, you SHOULD have matrix-to-IRC syncing turned
# on, else there will be no users and no bot in a channel (meaning no
# messages to Matrix!) until a Matrix user speaks which makes a client
# join the target IRC channel.
# NBB: The bridge bot IRC client will still join the target IRC network so
# it can service bridge-specific queries from the IRC-side e.g. so
# real IRC clients have a way to change their Matrix display name.
# See https://github.com/matrix-org/matrix-appservice-irc/issues/55
enabled: false
# The nickname to give the AS bot.
nick: "AuroreBot"
# The password to give to NickServ or IRC Server for this nick. Optional.
# password: "helloworld"
#
# Join channels even if there are no Matrix users on the other side of
# the bridge. Set to false to prevent the bot from joining channels which have no
# real matrix users in them, even if there is a mapping for the channel.
# Default: true
joinChannelsIfNoUsers: true
# Configuration for PMs / private 1:1 communications between users.
privateMessages:
# Enable the ability for PMs to be sent to/from IRC/Matrix.
# Default: true.
enabled: true
# Prevent Matrix users from sending PMs to the following IRC nicks.
# Optional. Default: [].
# exclude: ["Alice", "Bob"] # NOT YET IMPLEMENTED
# Should created Matrix PM rooms be federated? If false, only users on the
# HS attached to this AS will be able to interact with this room.
# Optional. Default: true.
federate: true
# Configuration for mappings not explicitly listed in the 'mappings'
# section.
dynamicChannels:
# Enable the ability for Matrix users to join *any* channel on this IRC
# network.
# Default: false.
enabled: true
# Should the AS create a room alias for the new Matrix room? The form of
# the alias can be modified via 'aliasTemplate'. Default: true.
createAlias: true
# Should the AS publish the new Matrix room to the public room list so
# anyone can see it? Default: true.
published: true
# What should the join_rule be for the new Matrix room? If 'public',
# anyone can join the room. If 'invite', only users with an invite can
# join the room. Note that if an IRC channel has +k or +i set on it,
# join_rules will be set to 'invite' until these modes are removed.
# Default: "public".
joinRule: public
# This will set the m.room.related_groups state event in newly created rooms
# with the given groupId. This means flares will show up on IRC users in those rooms.
# This should be set to the same thing as namespaces.users.group_id in irc_registration.
# This does not alter existing rooms.
# Leaving this option empty will not set the event.
groupId: +myircnetwork:localhost
# Should created Matrix rooms be federated? If false, only users on the
# HS attached to this AS will be able to interact with this room.
# Default: true.
federate: true
# The room alias template to apply when creating new aliases. This only
# applies if createAlias is 'true'. The following variables are exposed:
# $SERVER => The IRC server address (e.g. "irc.example.com")
# $CHANNEL => The IRC channel (e.g. "#python")
# This MUST have $CHANNEL somewhere in it.
# Default: '#irc_$SERVER_$CHANNEL'
aliasTemplate: "#irc_crans_$CHANNEL"
# A list of user IDs which the AS bot will send invites to in response
# to a !join. Only applies if joinRule is 'invite'. Default: []
# whitelist:
# - "@foo:example.com"
# - "@bar:example.com"
#
# Prevent the given list of channels from being mapped under any
# circumstances.
# exclude: ["#foo", "#bar"]
# Configuration for controlling how Matrix and IRC membership lists are
# synced.
membershipLists:
# Enable the syncing of membership lists between IRC and Matrix. This
# can have a significant effect on performance on startup as the lists are
# synced. This must be enabled for anything else in this section to take
# effect. Default: false.
enabled: true
# Syncing membership lists at startup can result in hundreds of members to
# process all at once. This timer drip feeds membership entries at the
# specified rate. Default: 10000. (10s)
floodDelayMs: 10000
global:
ircToMatrix:
# Get a snapshot of all real IRC users on a channel (via NAMES) and
# join their virtual matrix clients to the room.
initial: true
# Make virtual matrix clients join and leave rooms as their real IRC
# counterparts join/part channels. Default: false.
incremental: true
matrixToIrc:
# Get a snapshot of all real Matrix users in the room and join all of
# them to the mapped IRC channel on startup. Default: false.
initial: true
# Make virtual IRC clients join and leave channels as their real Matrix
# counterparts join/leave rooms. Make sure your 'maxClients' value is
# high enough! Default: false.
incremental: true
# Configuration for virtual matrix users. The following variables are
# exposed:
# $NICK => The IRC nick
# $SERVER => The IRC server address (e.g. "irc.example.com")
matrixClients:
# The user ID template to use when creating virtual matrix users. This
# MUST have $NICK somewhere in it.
# Optional. Default: "@$SERVER_$NICK".
# Example: "@irc.example.com_Alice:example.com"
userTemplate: "@irc_$NICK"
# The display name to use for created matrix clients. This should have
# $NICK somewhere in it if it is specified. Can also use $SERVER to
# insert the IRC domain.
# Optional. Default: "$NICK (IRC)". Example: "Alice (IRC)"
displayName: "$NICK (IRC)"
# Number of tries a client can attempt to join a room before the request
# is discarded. You can also use -1 to never retry or 0 to never give up.
# Optional. Default: -1
joinAttempts: -1
# Configuration for virtual IRC users. The following variables are exposed:
# $LOCALPART => The user ID localpart ("alice" in @alice:localhost)
# $USERID => The user ID
# $DISPLAY => The display name of this user, with excluded characters
# (e.g. space) removed. If the user has no display name, this
# falls back to $LOCALPART.
ircClients:
# The template to apply to every IRC client nick. This MUST have either
# $DISPLAY or $USERID or $LOCALPART somewhere in it.
# Optional. Default: "M-$DISPLAY". Example: "M-Alice".
nickTemplate: "$DISPLAY[m]"
# True to allow virtual IRC clients to change their nick on this server
# by issuing !nick <server> <nick> commands to the IRC AS bot.
# This is completely freeform: it will NOT follow the nickTemplate.
allowNickChanges: true
# The max number of IRC clients that will connect. If the limit is
# reached, the client that spoke the longest time ago will be
# disconnected and replaced.
# Optional. Default: 30.
maxClients: 30
# IPv6 configuration.
ipv6:
# Optional. Set to true to force IPv6 for outgoing connections.
only: false
# Optional. The IPv6 prefix to use for generating unique addresses for each
# connected user. If not specified, all users will connect from the same
# (default) address. This may require additional OS-specific work to allow
# for the node process to bind to multiple different source addresses
# e.g IP_FREEBIND on Linux, which requires an LD_PRELOAD with the library
# https://github.com/matrix-org/freebindfree as Node does not expose setsockopt.
# prefix: "2001:0db8:85a3::" # modify appropriately
#
# The maximum amount of time in seconds that the client can exist
# without sending another message before being disconnected. Use 0 to
# not apply an idle timeout. This value is ignored if this IRC server is
# mirroring matrix membership lists to IRC. Default: 172800 (48 hours)
idleTimeout: 10800
# The number of millseconds to wait between consecutive reconnections if a
# client gets disconnected. Setting to 0 will cause the scheduling to be
# disabled, i.e. it will be scheduled immediately (with jitter.
# Otherwise, the scheduling interval will be used such that one client
# reconnect for this server will be handled every reconnectIntervalMs ms using
# a FIFO queue.
# Default: 5000 (5 seconds)
reconnectIntervalMs: 5000
# The number of concurrent reconnects if a user has been disconnected unexpectedly
# (e.g. a netsplit). You should set this to a reasonably high number so that
# bridges are not waiting an eternity to reconnect all its clients if
# we see a massive number of disconnect. This is unrelated to the reconnectIntervalMs
# setting above which is for connecting on restart of the bridge. Set to 0 to
# immediately try to reconnect all users.
# Default: 50
concurrentReconnectLimit: 50
# The number of lines to allow being sent by the IRC client that has received
# a large block of text to send from matrix. If the number of lines that would
# be sent is > lineLimit, the text will instead be uploaded to matrix and the
# resulting URI is treated as a file. As such, a link will be sent to the IRC
# side instead of potentially spamming IRC and getting the IRC client kicked.
# Default: 3.
lineLimit: 3
# A list of user modes to set on every IRC client. For example, "RiG" would set
# +R, +i and +G on every IRC connection when they have successfully connected.
# User modes vary wildly depending on the IRC network you're connecting to,
# so check before setting this value. Some modes may not work as intended
# through the bridge e.g. caller ID as there is no way to /ACCEPT.
# Default: "" (no user modes)
# userModes: "R"
# Configuration for an ident server. If you are running a public bridge it is
# advised you setup an ident server so IRC mods can ban specific matrix users
# rather than the application service itself.
ident:
# True to listen for Ident requests and respond with the
# matrix user's user_id (converted to ASCII, respecting RFC 1413).
# Default: false.
enabled: false
# The port to listen on for incoming ident requests.
# Ports below 1024 require root to listen on, and you may not want this to
# run as root. Instead, you can get something like an Apache to yank up
# incoming requests to 113 to a high numbered port. Set the port to listen
# on instead of 113 here.
# Default: 113.
port: 1113
# The address to listen on for incoming ident requests.
# Default: 0.0.0.0
address: "::"
# Configuration for logging. Optional. Default: console debug level logging
# only.
logging:
# Level to log on console/logfile. One of error|warn|info|debug
level: "info"
# The file location to log to. This is relative to the project directory.
logfile: "debug.log"
# The file location to log errors to. This is relative to the project
# directory.
errfile: "errors.log"
# Whether to log to the console or not.
toConsole: true
# The max number of files to keep. Files will be overwritten eventually due
# to rotations.
maxFiles: 5
# Optional. Enable Prometheus metrics. If this is enabled, you MUST install `prom-client`:
# $ npm install prom-client@6.3.0
# Metrics will then be available via GET /metrics on the bridge listening port (-p).
metrics:
# Whether to actually enable the metric endpoint. Default: false
enabled: false
# When collecting remote user active times, which "buckets" should be used. Defaults are given below.
# The bucket name is formed of a duration and a period. (h=hours,d=days,w=weeks).
remoteUserAgeBuckets:
- "1h"
- "1d"
- "1w"
# The nedb database URI to connect to. This is the name of the directory to
# dump .db files to. This is relative to the project directory.
# Required.
databaseUri: "nedb://data"
# Configuration options for the debug HTTP API. To access this API, you must
# append ?access_token=$APPSERVICE_TOKEN (from the registration file) to the requests.
#
# The debug API exposes the following endpoints:
#
# GET /irc/$domain/user/$user_id => Return internal state for the IRC client for this user ID.
#
# POST /irc/$domain/user/$user_id => Issue a raw IRC command down this connection.
# Format: new line delimited commands as per IRC protocol.
#
debugApi:
# True to enable the HTTP API endpoint. Default: false.
enabled: false
# The port to host the HTTP API.
port: 11100
# Configuration for the provisioning API.
#
# GET /_matrix/provision/link
# GET /_matrix/provision/unlink
# GET /_matrix/provision/listlinks
#
provisioning:
# True to enable the provisioning HTTP endpoint. Default: false.
enabled: false
# The number of seconds to wait before giving up on getting a response from
# an IRC channel operator. If the channel operator does not respond within the
# allotted time period, the provisioning request will fail.
# Default: 300 seconds (5 mins)
requestTimeoutSeconds: 300
# WARNING: The bridge needs to send plaintext passwords to the IRC server, it cannot
# send a password hash. As a result, passwords (NOT hashes) are stored encrypted in
# the database.
#
# To generate a .pem file:
# $ openssl genpkey -out passkey.pem -outform PEM -algorithm RSA -pkeyopt rsa_keygen_bits:2048
#
# The path to the RSA PEM-formatted private key to use when encrypting IRC passwords
# for storage in the database. Passwords are stored by using the admin room command
# `!storepass server.name passw0rd. When a connection is made to IRC on behalf of
# the Matrix user, this password will be sent as the server password (PASS command).
passwordEncryptionKeyPath: "passkey.pem"
# Config for Matrix -> IRC bridging
matrixHandler:
# Cache this many matrix events in memory to be used for m.relates_to messages (usually replies).
eventCacheSize: 4096
# Options here are generally only applicable to large-scale bridges and may have
# consequences greater than other options in this configuration file.
advanced:
# The maximum number of HTTP(S) sockets to maintain. Usually this is unlimited
# however for large bridges it is important to rate limit the bridge to avoid
# accidentally overloading the homeserver. Defaults to 1000, which should be
# enough for the vast majority of use cases.
maxHttpSockets: 1000

Some files were not shown because too many files have changed in this diff Show more