summaryrefslogtreecommitdiff
path: root/roles/jitsi-enable-specific-imio/tasks/main.yml
blob: 981a477baff8b3bd503de66f65ffb4c6f0929051 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
---
- name: création du répertoire pour recevoir les fichiers statiques de IMIO
  file:
    path: /usr/share/jitsi-meet/static-imio
    state: directory

- name: personnalise la config nginx de l'accès jitsi principal
  blockinfile:
    path: /etc/nginx/sites-enabled/{{ inventory_hostname }}.conf
    marker: "# {mark} ANSIBLE MANAGED BLOCK"
    insertafter: "gzip_min_length 512;"
    block: |
      ### Pages static
        location = /rgpd {
            try_files /static-imio/imio-rgpd.html =404;
        }

        location ~ ^/$ {
            try_files /static-imio/imio-index.html =404;
        }

        location ~ ^/static-imio/(.*)$ {
          alias /usr/share/jitsi-meet/static-imio/$1;
        }
  notify:
    - reload nginx

- name: personnalise la config nginx de l'accès à cpas
  blockinfile:
    path: /etc/nginx/sites-enabled/{{ jitsi_multidomain_domain[0] }}.conf
    marker: "# {mark} ANSIBLE MANAGED BLOCK"
    insertafter: "gzip_min_length 512;"
    block: |
      #### Pages static
          location = /cpas {
            try_files /static-imio/cpas-cpas.html =404;
          }

          location = /rgpd {
              try_files /static-imio/cpas-rgpd.html =404;
          }

          location ~ ^/$ {
            try_files /static-imio/cpas-index.html =404;
          }

          location ~ ^/static-imio/(.*)$ {
            alias /usr/share/jitsi-meet/static-imio/$1;
          }
  notify:
    - reload nginx

- name: gestion du cookie la config nginx
  blockinfile:
    path: /etc/nginx/sites-enabled/{{ item }}.conf
    marker: "# {mark} ANSIBLE MANAGED COOKIE BLOCK"
    insertbefore: 'try_files \$uri @root_path'
    block: |
        # Ajout du cookie
        set $room $1;
        if ($http_cookie !~* "rgpd") {
           return 302 $scheme://$host/rgpd?room=$room;
        }
  loop: "{{ jitsi_multidomain_domain }}"
  notify:
    - reload nginx

- name: copy du logo
  copy:
    src: '../file/{{ item[0] }}'
    dest: '/usr/share/jitsi-meet/{{ item[1] }}'
    owner: root
    group: root
    mode: '0644'
  loop:
    - [ 'visio.imio.be.svg' , 'images/' ]

- name: Adaptation du js
  lineinfile:
    path: /usr/share/jitsi-meet/interface_config.js
    regexp: '{{ item[0] }}'
    line: '{{ item[1] }}'
  loop:
    - [ 'DEFAULT_LOGO_URL: ' , "    DEFAULT_LOGO_URL: 'images/visio.imio.be.svg'," ]
    - [ 'JITSI_WATERMARK_LINK: ' , "    JITSI_WATERMARK_LINK: 'https://imio.be'," ]