Files @ 9f804c9501da
Branch filter:

Location: majic-ansible-roles/roles/xmpp_server/tasks/main.yml

branko
MAR-39: Added support for specifying consumers of LDAP structure to the LDAP server role. Added support to the LDAP server role for specifying groups to create. Modified the ldap_entry implementation, replacing the addattributes/replaceattributes with append/replace states. The new states allow for creation of entry if it does not exist, making them more versatille. The existing classes and configurations have been updated accordingly.
---

- name: Install Python apt bindings
  apt: name=python-apt

- name: Add Prosody repository apt key
  apt_key:
    data: "{{ lookup('file', 'prosody-debian-packages.gpg') }}"
    state: present

- name: Add Prosody repository
  apt_repository: repo="deb http://packages.prosody.im/debian jessie main" state=present

- name: Install Lua Sec library (needed for TLS)
  apt: name=lua-sec state=installed

- name: Install Lua LDAP library
  apt: name=lua-ldap state=installed

- name: Install Prosody
  apt: name=prosody state=installed

- name: Allow Prosody user to traverse the directory with TLS private keys
  user: name=prosody append=yes groups=ssl-cert

- name: Deploy XMPP TLS private key
  copy: dest="/etc/ssl/private/{{ xmpp_tls_key | basename }}" src="{{ xmpp_tls_key }}"
        mode=640 owner=root group=prosody
  notify:
    - Restart Prosody

- name: Deploy XMPP TLS certificate
  copy: dest="/etc/ssl/certs/{{ xmpp_tls_certificate | basename }}" src="{{ xmpp_tls_certificate }}"
        mode=644 owner=root group=root
  notify:
    - Restart Prosody

- name: Set-up directory for storing additional Prosody modules
  file: path=/usr/local/lib/prosody/modules/ state=directory mode=755 owner=root group=root

- name: Deploy the Prosody mod_auth_ldap module
  get_url: url=https://prosody-modules.googlecode.com/hg/mod_auth_ldap/mod_auth_ldap.lua
           dest=/usr/local/lib/prosody/modules/mod_auth_ldap.lua

- name: Set-up file permissions for the Prosody mod_auth_ldap module
  file: dest=/usr/local/lib/prosody/modules/mod_auth_ldap.lua owner=root group=root mode=644

- name: Deploy Prosody configuration file
  template: src=prosody.cfg.lua.j2 dest=/etc/prosody/prosody.cfg.lua
  notify:
    - Restart Prosody

- name: Enable and start Prosody service
  service: name=prosody enabled=yes state=started

- name: Deploy firewall configuration for XMPP server
  copy: src="ferm_xmpp.conf" dest="/etc/ferm/conf.d/30-xmpp.conf" owner=root group=root mode=640
  notify:
    - Restart ferm