2019-02-07 13:37:03 +01:00
|
|
|
---
|
2019-02-07 13:04:46 +01:00
|
|
|
# Install HTTPS support for APT
|
|
|
|
- name: Install apt-transport-https
|
2019-02-07 13:37:03 +01:00
|
|
|
apt:
|
2019-03-03 09:00:29 +01:00
|
|
|
update_cache: true
|
2019-03-23 19:25:04 +01:00
|
|
|
name: apt-transport-https
|
|
|
|
state: present
|
2019-03-03 19:28:57 +01:00
|
|
|
register: apt_result
|
|
|
|
retries: 3
|
|
|
|
until: apt_result is succeeded
|
2019-02-07 13:37:03 +01:00
|
|
|
|
|
|
|
# Add the repository into source list
|
2019-02-07 13:04:46 +01:00
|
|
|
- name: Configure riot repository
|
2019-02-07 13:37:03 +01:00
|
|
|
apt_repository:
|
2019-03-23 19:13:02 +01:00
|
|
|
repo: deb https://riot.im/packages/debian/ {{ ansible_distribution_release }} main
|
2019-03-23 19:25:04 +01:00
|
|
|
state: present
|
2019-03-02 12:07:48 +01:00
|
|
|
|
2019-02-07 13:37:03 +01:00
|
|
|
# Add the key
|
2019-02-07 13:04:46 +01:00
|
|
|
- name: Configure the apt key
|
2019-02-07 13:37:03 +01:00
|
|
|
apt_key:
|
|
|
|
url: https://riot.im/packages/debian/repo-key.asc
|
|
|
|
id: E019645248E8F4A1
|
2019-03-23 19:25:04 +01:00
|
|
|
state: present
|
2019-03-03 19:28:57 +01:00
|
|
|
register: apt_key_result
|
|
|
|
retries: 3
|
|
|
|
until: apt_key_result is succeeded
|
2019-02-07 13:37:03 +01:00
|
|
|
|
|
|
|
# Install riot
|
2019-02-07 13:04:46 +01:00
|
|
|
- name: Install riot-web
|
2019-02-07 13:37:03 +01:00
|
|
|
apt:
|
2019-03-03 09:00:29 +01:00
|
|
|
update_cache: true
|
2019-03-23 19:25:04 +01:00
|
|
|
name: riot-web
|
|
|
|
state: present
|
2019-03-03 19:28:57 +01:00
|
|
|
register: apt_result
|
|
|
|
retries: 3
|
|
|
|
until: apt_result is succeeded
|
2019-02-07 13:37:03 +01:00
|
|
|
|
|
|
|
# Install nginx
|
2019-02-07 13:04:46 +01:00
|
|
|
- name: Install nginx
|
2019-02-07 13:37:03 +01:00
|
|
|
apt:
|
|
|
|
name: nginx
|
2019-03-23 19:25:04 +01:00
|
|
|
state: present
|
2019-03-03 19:28:57 +01:00
|
|
|
register: apt_result
|
|
|
|
retries: 3
|
|
|
|
until: apt_result is succeeded
|
2019-02-07 13:37:03 +01:00
|
|
|
|
|
|
|
# Configure nginx
|
2019-02-07 13:04:46 +01:00
|
|
|
- name: Configure nginx
|
2019-02-07 13:37:03 +01:00
|
|
|
template:
|
|
|
|
src: nginx-riot.j2
|
|
|
|
dest: /etc/nginx/sites-available/riot
|
2019-03-02 12:07:48 +01:00
|
|
|
mode: 0644
|
2019-02-07 13:37:03 +01:00
|
|
|
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
|