|
14 | 14 | raw: sudo apt-get install -y python
|
15 | 15 |
|
16 | 16 | tasks:
|
| 17 | + ######################### |
| 18 | + # System Configuration |
| 19 | + ######################### |
17 | 20 | - name: Install system packages
|
18 | 21 | become: yes
|
19 | 22 | apt:
|
|
34 | 37 | - software-properties-common
|
35 | 38 | - sqlite3
|
36 | 39 |
|
| 40 | + ######################### |
| 41 | + # Synapse Configuration |
| 42 | + ######################### |
37 | 43 | - name: Create Synapse directory
|
38 | 44 | file:
|
39 | 45 | path: "{{ synapse_path }}"
|
|
72 | 78 | with_items:
|
73 | 79 | - pip
|
74 | 80 | - setuptools
|
75 |
| - - https://github.com/matrix-org/synapse/tarball/master |
| 81 | + - "{{ synapse_release }}" |
76 | 82 |
|
77 | 83 | - name: Register if homeserver config exists
|
78 | 84 | stat:
|
|
98 | 104 | dest: /etc/systemd/system/synapse.service
|
99 | 105 | mode: 0644
|
100 | 106 |
|
101 |
| - - name: Create static directories |
| 107 | + ######################### |
| 108 | + # Riot Configuration |
| 109 | + ######################### |
| 110 | + - name: Download Riot release archive |
| 111 | + get_url: |
| 112 | + url: "{{ riot_release }}" |
| 113 | + dest: "{{ riot_path }}.tar.gz" |
| 114 | + |
| 115 | + - name: Extract Riot release archive |
| 116 | + unarchive: |
| 117 | + src: "{{ riot_path }}.tar.gz" |
| 118 | + dest: "{{ home }}" |
| 119 | + remote_src: yes |
| 120 | + list_files: yes |
| 121 | + register: riot_archive |
| 122 | + |
| 123 | + - name: Symlink Riot src for Nginx |
102 | 124 | become: yes
|
103 | 125 | file:
|
104 |
| - path: "{{ logo_path }}" |
105 |
| - state: directory |
106 |
| - owner: "{{ remote_user }}" |
107 |
| - group: "www-data" |
108 |
| - recurse: yes |
| 126 | + src: "{{ home }}/{{ riot_archive.files[0] }}" |
| 127 | + dest: /usr/share/nginx/html |
| 128 | + state: link |
109 | 129 |
|
110 |
| - - name: Copy logo images |
111 |
| - copy: |
112 |
| - src: "{{ item }}" |
113 |
| - dest: "/data/_matrix/client/{{ item }}" |
114 |
| - with_items: "{{ images }}" |
| 130 | + - name: Configure Riot |
| 131 | + template: |
| 132 | + src: riot/config.j2 |
| 133 | + dest: "{{ home }}/{{ riot_archive.files[0] }}/config.json" |
115 | 134 |
|
116 |
| - - name: Create Nginx config |
| 135 | + ######################### |
| 136 | + # Nginx configuration |
| 137 | + ######################### |
| 138 | + - name: Configure Nginx |
117 | 139 | become: yes
|
118 | 140 | template:
|
119 | 141 | src: nginx/nginx.j2
|
120 | 142 | dest: /etc/nginx/nginx.conf
|
121 | 143 |
|
| 144 | + ######################### |
| 145 | + # Load and start services |
| 146 | + ######################### |
122 | 147 | - name: Reloading Daemons
|
123 | 148 | become: yes
|
124 | 149 | command: systemctl daemon-reload
|
125 | 150 |
|
126 |
| - - name: Enabling service |
| 151 | + - name: Enabling Synapse service |
127 | 152 | become: yes
|
128 | 153 | command: systemctl enable synapse
|
129 | 154 |
|
|
0 commit comments