From 85b09b3cbdaabbc8ee7e88247c78fb77ab81667b Mon Sep 17 00:00:00 2001 From: Luke Hoersten Date: Thu, 14 May 2020 08:25:10 -0500 Subject: Added prosody role. --- prosody/defaults/main.yaml | 1 + prosody/handlers/main.yaml | 5 +++++ prosody/tasks/main.yaml | 26 ++++++++++++++++++++++++++ prosody/templates/prosody.cfg.lua.j2 | 20 ++++++++++++++++++++ 4 files changed, 52 insertions(+) create mode 100644 prosody/defaults/main.yaml create mode 100644 prosody/handlers/main.yaml create mode 100644 prosody/tasks/main.yaml create mode 100644 prosody/templates/prosody.cfg.lua.j2 (limited to 'prosody') diff --git a/prosody/defaults/main.yaml b/prosody/defaults/main.yaml new file mode 100644 index 0000000..ed97d53 --- /dev/null +++ b/prosody/defaults/main.yaml @@ -0,0 +1 @@ +--- diff --git a/prosody/handlers/main.yaml b/prosody/handlers/main.yaml new file mode 100644 index 0000000..fea0e7d --- /dev/null +++ b/prosody/handlers/main.yaml @@ -0,0 +1,5 @@ +--- + +- name: restart prosody + become: yes + systemd: name="prosody.service" enabled="yes" daemon_reload="yes" diff --git a/prosody/tasks/main.yaml b/prosody/tasks/main.yaml new file mode 100644 index 0000000..f14ec9a --- /dev/null +++ b/prosody/tasks/main.yaml @@ -0,0 +1,26 @@ +--- + +- name: install prosody + become: yes + apt: name="prosody" + notify: restart prosody + +- name: configure prosody + become: yes + template: + src: "prosody.cfg.lua.j2" + dest: "/etc/prosody/conf.avail/{{prosody_vhost}}.cfg.lua" + notify: restart prosody + +- name: install prosody site + become: yes + template: src="prosody.cfg.lua.j2" dest="/etc/prosody/conf.avail/{{prosody_vhost}}.cfg.lua" + notify: restart prosody + +- name: enable prosody site + become: yes + file: + src: "/etc/prosody/conf.avail/{{prosody_vhost}}.cfg.lua" + dest: "/etc/prosody/conf.d/{{prosody_vhost}}.cfg.lua" + state: "link" + notify: restart prosody diff --git a/prosody/templates/prosody.cfg.lua.j2 b/prosody/templates/prosody.cfg.lua.j2 new file mode 100644 index 0000000..15a1b38 --- /dev/null +++ b/prosody/templates/prosody.cfg.lua.j2 @@ -0,0 +1,20 @@ +VirtualHost "{{prosody_vhost}}" + ssl = { + key = "{{prosody_ssl_privkey}}"; + certificate = "{{prosody_ssl_cert}}"; + } + +------ Components ------ +-- You can specify components to add hosts that provide special services, +-- like multi-user conferences, and transports. +-- For more information on components, see http://prosody.im/doc/components + +-- Set up a MUC (multi-user chat) room server on conference.example.com: +--Component "conference.example.com" "muc" + +-- Set up a SOCKS5 bytestream proxy for server-proxied file transfers: +--Component "proxy.example.com" "proxy65" + +---Set up an external component (default component port is 5347) +--Component "gateway.example.com" +-- component_secret = "password" -- cgit v1.2.3