Install and maintain Prosody from official repo with Ansible. Tested with Molecule, Docker and Vagrant.
Debian 11. Other versions of Debian/Ubuntu might be supported as well, but aren't tested.
see defaults/main.yml
Download latest release with ansible-galaxy
ansible-galaxy install systemli.prosody
- hosts: servers
roles:
- systemli.prosody
vars:
prosody_virtual_hosts:
- name: example.net
key: |
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
cert: |
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
- name: x5tno6mwkncu4m2h.onion
admins: ["admin@x5tno6mwkncu4m2h.onion"]
You would need a configured Tor onion service for this. Look at systemli.onion.
You can also combine it with systemli.letsencrypt to automatically configure certs.
- hosts: servers
roles:
- systemli.letsencrypt
- systemli.prosody
vars:
prosody_vhost: example.net
letsencrypt_cert:
name: example.net
domains:
- example.net
- conference.example.net
- proxy.example.net
- pubsub.example.net
challenge: dns
renew_hook: "/usr/bin/prosodyctl --root cert import /etc/letsencrypt/live/"
Run local tests with
molecule test
Requires Molecule, Vagrant and python-vagrant
to be installed.
To update vars in tests run
j2 --customize ~/custom-j2.py templates/test_prosody.yml.j2 defaults/main.yml > molecule/default/tests/test_default.yml
# ~/custom-j2.py
def j2_environment_params():
""" Extra parameters for the Jinja2 Environment """
# Jinja2 Environment configuration
# http://jinja.pocoo.org/docs/2.10/api/#jinja2.Environment
return dict(
# Remove whitespace around blocks
trim_blocks=True,
)
GPL