--- - 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"