diff options
Diffstat (limited to 'matrix/synapse01.yml')
-rw-r--r-- | matrix/synapse01.yml | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/matrix/synapse01.yml b/matrix/synapse01.yml new file mode 100644 index 0000000..d7f38ab --- /dev/null +++ b/matrix/synapse01.yml @@ -0,0 +1,63 @@ +--- +- hosts: localhost + remote_user: peter + become: yes + vars: + federation_server: "matrix.example.com" + client_server: "example.com" + dbuser: "synapse" + dbpass: "" + database: "synapse" + packages: [matrix-synapse, postgresql, nginx, python-psycopg2] + synapse_repo: "files/synapse.list" + synapse_config: "files/homeserver.yaml.j2" + nginx_config: "files/nginx.j2" + ssl_available: false + tasks: + - name: Get hostname + shell: hostname + register: hostname + become: no + - name: Install Synapse repo + copy: + src: "{{ synapse_repo }}" + dest: /etc/apt/sources.list.d/synapse.list + - name: Install Synapse repo key + apt_key: + url: https://matrix.org/packages/debian/repo-key.asc + state: present + - name: Install Packages + apt: + name: "{{ packages }}" + update_cache: yes + state: installed + install_recommends: no + - name: Create ACME dir + file: + path: "/var/www/{{ federation_server }}" + state: directory + owner: www-data + group: www-data + - name: Create nginx log dir + file: + path: "/var/log/nginx/{{ federation_server }}" + state: directory + owner: www-data + group: www-data + - name: Setup nginx w/o HTTPS + template: + src: "{{ nginx_config }}" + dest: "/etc/nginx/sites-available/{{ federation_server }}.conf" + - name: Link nginx config + file: + path: "/etc/nginx/sites-enabled/{{ federation_server }}.conf" + src: "/etc/nginx/sites-available/{{ federation_server }}.conf" + state: link + - name: Start nginx + service: + name: nginx + state: started + enabled: yes + - name: Done part 1 + debug: + msg: "Pre-Setup done, create a Key and Certificate and move them to /etc/ssl/certs/{{ federation_server }}.pem and /etc/ssl/certs/{{ federation_server }}.pem" |