summaryrefslogtreecommitdiff
path: root/roles
diff options
context:
space:
mode:
authorAntoine Ouvrard <antoine.ouvrard@nereide.fr>2021-06-24 17:33:20 +0200
committerAntoine Ouvrard <antoine.ouvrard@nereide.fr>2021-06-24 17:33:20 +0200
commit6dbce618b1950b6e01018855cc28e964c60fcb16 (patch)
treeaa153ac993ed6ef6362bd55149afa3a7e514cebc /roles
parentcc208f6ebf74671fe4e99fb2561ceff911f8737b (diff)
nouveau role BBB qui active les notifications par mails
Diffstat (limited to 'roles')
-rw-r--r--roles/bbb-enable-nrd-smtp/handlers/main.yml3
-rw-r--r--roles/bbb-enable-nrd-smtp/tasks/main.yml74
2 files changed, 77 insertions, 0 deletions
diff --git a/roles/bbb-enable-nrd-smtp/handlers/main.yml b/roles/bbb-enable-nrd-smtp/handlers/main.yml
new file mode 100644
index 0000000..53c613a
--- /dev/null
+++ b/roles/bbb-enable-nrd-smtp/handlers/main.yml
@@ -0,0 +1,3 @@
+---
+- name: restart greenlight
+ shell: "cd /root/greenlight; docker-compose down; docker-compose up -d"
diff --git a/roles/bbb-enable-nrd-smtp/tasks/main.yml b/roles/bbb-enable-nrd-smtp/tasks/main.yml
new file mode 100644
index 0000000..711b7dd
--- /dev/null
+++ b/roles/bbb-enable-nrd-smtp/tasks/main.yml
@@ -0,0 +1,74 @@
+---
+# Configure le relay SMTP Gandi de Néréide pour que BBB envoie des mails
+
+- name: ajout du serveur SMTP
+ lineinfile:
+ path: "/root/greenlight/.env"
+ regexp: "^SMTP_SERVER="
+ line: "SMTP_SERVER=mail.gandi.net"
+ notify:
+ - restart greenlight
+
+- name: ajout du SMTP_PORT
+ lineinfile:
+ path: "/root/greenlight/.env"
+ regexp: "^SMTP_PORT="
+ line: "SMTP_PORT=587"
+ notify:
+ - restart greenlight
+
+- name: ajout du SMTP_DOMAIN
+ lineinfile:
+ path: "/root/greenlight/.env"
+ regexp: "^SMTP_DOMAIN="
+ line: "SMTP_DOMAIN=nereide.fr"
+ notify:
+ - restart greenlight
+
+- name: ajout du SMTP_USERNAME
+ lineinfile:
+ path: "/root/greenlight/.env"
+ regexp: "^SMTP_USERNAME="
+ line: "SMTP_USERNAME=relay-smtp@nereide.fr"
+ notify:
+ - restart greenlight
+
+- name: ajout du SMTP_PASSWORD
+ lineinfile:
+ path: "/root/greenlight/.env"
+ regexp: "^SMTP_PASSWORD="
+ line: "SMTP_PASSWORD={{ vault_smtp_nrd_pass }}"
+ notify:
+ - restart greenlight
+
+- name: ajout du SMTP_AUTH
+ lineinfile:
+ path: "/root/greenlight/.env"
+ regexp: "^SMTP_AUTH="
+ line: "SMTP_AUTH=plain"
+ notify:
+ - restart greenlight
+
+- name: ajout du SMTP_STARTTLS_AUTO
+ lineinfile:
+ path: "/root/greenlight/.env"
+ regexp: "^SMTP_STARTTLS_AUTO="
+ line: "SMTP_STARTTLS_AUTO=true"
+ notify:
+ - restart greenlight
+
+- name: ajout du SMTP_SENDER
+ lineinfile:
+ path: "/root/greenlight/.env"
+ regexp: "^SMTP_SENDER="
+ line: "SMTP_SENDER=no-reply@bbb.fr"
+ notify:
+ - restart greenlight
+
+- name: Activation des notifications par mails
+ lineinfile:
+ path: "/root/greenlight/.env"
+ insertafter: "^# ALLOW_MAIL_NOTIFICATIONS=true"
+ line: "ALLOW_MAIL_NOTIFICATIONS=true"
+ notify:
+ - restart greenlight