prosody/tasks/main.yaml
author Luke Hoersten <luke@hoersten.org>
Sun, 14 Jun 2020 14:50:21 -0500
changeset 44 aaf10cecfc1f
parent 23 b4ad03deace1
child 45 2d7ba960b157
permissions -rw-r--r--
Copy prosody keys over.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
23
b4ad03deace1 Added prosody role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     1
---
b4ad03deace1 Added prosody role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     2
b4ad03deace1 Added prosody role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     3
- name: install prosody
b4ad03deace1 Added prosody role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     4
  become: yes
b4ad03deace1 Added prosody role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     5
  apt: name="prosody"
b4ad03deace1 Added prosody role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     6
  notify: restart prosody
b4ad03deace1 Added prosody role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     7
b4ad03deace1 Added prosody role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     8
- name: configure prosody
b4ad03deace1 Added prosody role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     9
  become: yes
b4ad03deace1 Added prosody role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    10
  template:
b4ad03deace1 Added prosody role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    11
    src: "prosody.cfg.lua.j2"
b4ad03deace1 Added prosody role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    12
    dest: "/etc/prosody/conf.avail/{{prosody_vhost}}.cfg.lua"
b4ad03deace1 Added prosody role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    13
  notify: restart prosody
b4ad03deace1 Added prosody role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    14
b4ad03deace1 Added prosody role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    15
- name: install prosody site
b4ad03deace1 Added prosody role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    16
  become: yes
b4ad03deace1 Added prosody role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    17
  template: src="prosody.cfg.lua.j2" dest="/etc/prosody/conf.avail/{{prosody_vhost}}.cfg.lua"
b4ad03deace1 Added prosody role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    18
  notify: restart prosody
b4ad03deace1 Added prosody role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    19
44
aaf10cecfc1f Copy prosody keys over.
Luke Hoersten <luke@hoersten.org>
parents: 23
diff changeset
    20
- name: copy ssl keys
aaf10cecfc1f Copy prosody keys over.
Luke Hoersten <luke@hoersten.org>
parents: 23
diff changeset
    21
  become: yes
aaf10cecfc1f Copy prosody keys over.
Luke Hoersten <luke@hoersten.org>
parents: 23
diff changeset
    22
  copy:
aaf10cecfc1f Copy prosody keys over.
Luke Hoersten <luke@hoersten.org>
parents: 23
diff changeset
    23
    src: "{{item}}"
aaf10cecfc1f Copy prosody keys over.
Luke Hoersten <luke@hoersten.org>
parents: 23
diff changeset
    24
    dest: "{{prosody_ssl_dir}}/"
aaf10cecfc1f Copy prosody keys over.
Luke Hoersten <luke@hoersten.org>
parents: 23
diff changeset
    25
    remote_src: yes
aaf10cecfc1f Copy prosody keys over.
Luke Hoersten <luke@hoersten.org>
parents: 23
diff changeset
    26
    mode: "0640"
aaf10cecfc1f Copy prosody keys over.
Luke Hoersten <luke@hoersten.org>
parents: 23
diff changeset
    27
    owner: "root"
aaf10cecfc1f Copy prosody keys over.
Luke Hoersten <luke@hoersten.org>
parents: 23
diff changeset
    28
    group: "prosody"
aaf10cecfc1f Copy prosody keys over.
Luke Hoersten <luke@hoersten.org>
parents: 23
diff changeset
    29
  notify: restart prosody
aaf10cecfc1f Copy prosody keys over.
Luke Hoersten <luke@hoersten.org>
parents: 23
diff changeset
    30
  loop:
aaf10cecfc1f Copy prosody keys over.
Luke Hoersten <luke@hoersten.org>
parents: 23
diff changeset
    31
    - "{{prosody_ssl_privkey_src}}"
aaf10cecfc1f Copy prosody keys over.
Luke Hoersten <luke@hoersten.org>
parents: 23
diff changeset
    32
    - "{{prosody_ssl_cert_src}}"
aaf10cecfc1f Copy prosody keys over.
Luke Hoersten <luke@hoersten.org>
parents: 23
diff changeset
    33
23
b4ad03deace1 Added prosody role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    34
- name: enable prosody site
b4ad03deace1 Added prosody role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    35
  become: yes
b4ad03deace1 Added prosody role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    36
  file:
b4ad03deace1 Added prosody role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    37
    src:  "/etc/prosody/conf.avail/{{prosody_vhost}}.cfg.lua"
b4ad03deace1 Added prosody role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    38
    dest: "/etc/prosody/conf.d/{{prosody_vhost}}.cfg.lua"
b4ad03deace1 Added prosody role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    39
    state: "link"
b4ad03deace1 Added prosody role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    40
  notify: restart prosody