Changeset - f8e0fd7936c4
[Not reviewed]
0 6 0
Branko Majic (branko) - 7 years ago 2018-11-24 15:13:00
branko@majic.rs
MAR-139: Switch to using Prosody stable branch nightlies:

- Introduced additional parameter for specifying name of Prosody
package to install.
- Updated tests.
6 files changed with 25 insertions and 5 deletions:
0 comments (0 inline, 0 general)
roles/xmpp_server/defaults/main.yml
Show inline comments
 
---
 

	
 
enable_backup: False
 
xmpp_domains:
 
  - "{{ ansible_domain }}"
 
xmpp_prosody_package: "prosody-0.10"
 
xmpp_tls_certificate: "{{ lookup('file', tls_certificate_dir + '/' + ansible_fqdn + '_xmpp.pem') }}"
 
xmpp_tls_key: "{{ lookup('file', tls_private_key_dir + '/' + ansible_fqdn + '_xmpp.key') }}"
roles/xmpp_server/playbook.yml
Show inline comments
 
@@ -219,12 +219,13 @@
 
      xmpp_domains:
 
        - domain2
 
        - domain3
 
      xmpp_ldap_base_dn: dc=local
 
      xmpp_ldap_password: prosodypassword
 
      xmpp_ldap_server: ldap-server
 
      xmpp_prosody_package: prosody-0.9
 
      xmpp_tls_certificate: "{{ lookup('file', 'tests/data/x509/parameters-optional_xmpp.cert.pem') }}"
 
      xmpp_tls_key: "{{ lookup('file', 'tests/data/x509/parameters-optional_xmpp.key.pem') }}"
 

	
 
      # Common parameters (general, not role).
 
      tls_certificate_dir: tests/data/x509/
 
      tls_private_key_dir: tests/data/x509/
roles/xmpp_server/tasks/main.yml
Show inline comments
 
@@ -23,14 +23,16 @@
 
  apt:
 
    name: lua-ldap
 
    state: installed
 

	
 
- name: Install Prosody
 
  apt:
 
    name: prosody
 
    state: installed
 
    name: "{{ xmpp_prosody_package }}"
 
    state: present
 
  notify:
 
    - Restart Prosody
 

	
 
- name: Allow Prosody user to traverse the directory with TLS private keys
 
  user:
 
    name: prosody
 
    append: yes
 
    groups: ssl-cert
roles/xmpp_server/tests/test_default.py
Show inline comments
 
@@ -2,21 +2,21 @@ import testinfra.utils.ansible_runner
 

	
 

	
 
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
 
    '.molecule/ansible_inventory').get_hosts(['parameters-mandatory', 'parameters-optional'])
 

	
 

	
 
def test_installed_packages(Package):
 
def test_supporting_packages_installed(Package):
 
    """
 
    Tests if all the necessary packages have been installed.
 
    Tests if all the necessary supporting packages have been
 
    installed.
 
    """
 

	
 
    assert Package('python-apt').is_installed
 
    assert Package('lua-sec').is_installed
 
    assert Package('lua-ldap').is_installed
 
    assert Package('prosody').is_installed
 

	
 

	
 
def test_prosody_apt_key(Command):
 
    """
 
    Tests if Prosody repository signing key has been imported.
 
    """
roles/xmpp_server/tests/test_mandatory.py
Show inline comments
 
@@ -62,6 +62,14 @@ def test_prosody_configuration_file_content(File, Sudo):
 

	
 
        assert """VirtualHost "domain1"
 
Component "conference.domain1" "muc"
 
  restrict_room_creation = "local"
 
Component "proxy.domain1" "proxy65"
 
  proxy65_acl = { "domain1" }""" in config.content
 

	
 

	
 
def test_correct_prosody_package_installed(Package):
 
    """
 
    Tests if correct Prosody package has been installed.
 
    """
 

	
 
    assert Package('prosody-0.10').is_installed
roles/xmpp_server/tests/test_optional.py
Show inline comments
 
@@ -68,6 +68,14 @@ Component "proxy.domain2" "proxy65"
 

	
 
        assert """VirtualHost "domain3"
 
Component "conference.domain3" "muc"
 
  restrict_room_creation = "local"
 
Component "proxy.domain3" "proxy65"
 
  proxy65_acl = { "domain3" }""" in config.content
 

	
 

	
 
def test_correct_prosody_package_installed(Package):
 
    """
 
    Tests if correct Prosody package has been installed.
 
    """
 

	
 
    assert Package('prosody-0.9').is_installed
0 comments (0 inline, 0 general)