|
| 1 | +# Install Jitsi Meet on ubuntu 20.04 and 22.04 based on the official quick install guide |
| 2 | +# https://jitsi.github.io/handbook/docs/devops-guide/devops-guide-quickstart |
| 3 | + |
| 4 | +- name: Jitsi Setup |
| 5 | + hosts: localhost |
| 6 | + tasks: |
| 7 | +#1 - Disable ssh access and restart the ssh service |
| 8 | + - name: Restarting sshd |
| 9 | + shell: "sed -i 's/#Match User anoncvs/ForceCommand echo Please wait until the installation is completed..../g' /etc/ssh/sshd_config && systemctl restart sshd" |
| 10 | + |
| 11 | +# 2 - Update the system |
| 12 | + - name: Updating Packages |
| 13 | + ansible.builtin.apt: |
| 14 | + update_cache: yes |
| 15 | + |
| 16 | +# 3 - Install the required packages |
| 17 | + - name: Install required packages |
| 18 | + ansible.builtin.apt: |
| 19 | + name: "{{ packages }}" |
| 20 | + state: present |
| 21 | + vars: |
| 22 | + packages: |
| 23 | + - apt-transport-https |
| 24 | + - ca-certificates |
| 25 | + - curl |
| 26 | + - gnupg2 |
| 27 | + - nginx-full |
| 28 | + - wget |
| 29 | + - software-properties-common |
| 30 | + - certbot |
| 31 | + - python3-certbot-nginx |
| 32 | + |
| 33 | +# 4 - Enable the universe repository |
| 34 | + - name: enable the universe repository |
| 35 | + shell: apt-add-repository universe |
| 36 | + |
| 37 | +# 5 - Update System packages |
| 38 | + - name: Updating Packages |
| 39 | + ansible.builtin.apt: |
| 40 | + update_cache: yes |
| 41 | + |
| 42 | +# 6 - Check if the Os version is 20 or 22 |
| 43 | + - name: Check if the Os version is 20 or 22 |
| 44 | + shell: lsb_release -rs |
| 45 | + register: os_version |
| 46 | + |
| 47 | +# 7 - If the OS version is ubuntu 20.04 then Add the Prosody package repository |
| 48 | + - name: Add the Prosody package repository |
| 49 | + shell: | |
| 50 | + echo deb http://packages.prosody.im/debian $(lsb_release -sc) main | sudo tee -a /etc/apt/sources.list |
| 51 | + wget https://prosody.im/files/prosody-debian-packages.key -O- | sudo apt-key add - |
| 52 | + when: os_version.stdout == "20.04" |
| 53 | + |
| 54 | +# 8 - If the OS version is ubuntu 22.04 then Add the Prosody package repository |
| 55 | + - name: Add the Prosody package repository |
| 56 | + shell: | |
| 57 | + echo deb http://packages.prosody.im/debian $(lsb_release -sc) main | sudo tee -a /etc/apt/sources.list |
| 58 | + wget https://prosody.im/files/prosody-debian-packages.key -O- | sudo apt-key add - |
| 59 | + when: os_version.stdout == "22.04" |
| 60 | + |
| 61 | +# 9 - Add the Jitsi package repository if the OS version is ubuntu 20.04 |
| 62 | + - name: Add the Jitsi package repository |
| 63 | + shell: | |
| 64 | + curl https://download.jitsi.org/jitsi-key.gpg.key | sudo sh -c 'gpg --dearmor > /usr/share/keyrings/jitsi-keyring.gpg' |
| 65 | + echo 'deb [signed-by=/usr/share/keyrings/jitsi-keyring.gpg] https://download.jitsi.org stable/' | sudo tee /etc/apt/sources.list.d/jitsi-stable.list > /dev/null |
| 66 | + when: os_version.stdout == "20.04" |
| 67 | + |
| 68 | +# 9 - Add the Jitsi package repository if the OS version is ubuntu 22.04 |
| 69 | + - name: Add the Jitsi package repository |
| 70 | + shell: | |
| 71 | + curl -sL https://download.jitsi.org/jitsi-key.gpg.key | sudo sh -c 'gpg --dearmor > /usr/share/keyrings/jitsi-keyring.gpg' |
| 72 | + echo "deb [signed-by=/usr/share/keyrings/jitsi-keyring.gpg] https://download.jitsi.org stable/" | sudo tee /etc/apt/sources.list.d/jitsi-stable.list |
| 73 | + when: os_version.stdout == "22.04" |
| 74 | + |
| 75 | +# 10 - Update System packages |
| 76 | + - name: Updating Packages |
| 77 | + ansible.builtin.apt: |
| 78 | + update_cache: yes |
| 79 | + |
| 80 | +# 18 - Change the default processes and open files on server |
| 81 | + - name: Change the default processes and open files on server |
| 82 | + shell: | |
| 83 | + echo "DefaultLimitNOFILE=65000" >> /etc/systemd/system.conf |
| 84 | + echo "DefaultLimitNPROC=65000" >> /etc/systemd/system.conf |
| 85 | + echo "DefaultTasksMax=65000" >> /etc/systemd/system.conf |
| 86 | +
|
| 87 | +# 19 - Restart the systemd daemon |
| 88 | + - name: Restart the systemd daemon |
| 89 | + shell: systemctl daemon-reload |
| 90 | + |
| 91 | +# 7 - create a cloudstack directory |
| 92 | + - name: Creating a directory for shell script |
| 93 | + ansible.builtin.file: |
| 94 | + path: /opt/JitsiMeet |
| 95 | + state: directory |
| 96 | + |
| 97 | +# 8 - copy the shell script from /opt/ to /opt/cloudstack |
| 98 | + - name: Copy files for shell script |
| 99 | + copy: |
| 100 | + src: "{{ item.confsrc }}" |
| 101 | + dest: "{{ item.confdest }}" |
| 102 | + remote_src: yes |
| 103 | + with_items: |
| 104 | + - { confsrc: '/usr/local/src/JitsiMeet/JitsiMeet-cleanup.sh', confdest: '/opt/JitsiMeet'} |
| 105 | + |
| 106 | +# 9 - Add the shell script to .bashrc |
| 107 | + - name: Adding a line for shell script |
| 108 | + lineinfile: |
| 109 | + path: /root/.bashrc |
| 110 | + line: "chmod +x /opt/JitsiMeet/JitsiMeet-cleanup.sh && /opt/JitsiMeet/JitsiMeet-cleanup.sh" |
| 111 | + state: present |
| 112 | + |
| 113 | +# 10 - Enable the ssh acess and restart the sshd service |
| 114 | + - name: Restarting sshd |
| 115 | + shell: "sed -i 's/ForceCommand echo Please wait until the installation is completed..../#Match User anoncvs/g' /etc/ssh/sshd_config && systemctl restart sshd" |
0 commit comments