Changeset - f8e0fd7936c4
[Not reviewed]
0 6 0
Branko Majic (branko) - 5 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
 
@@ -3,5 +3,6 @@
 
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
 
@@ -222,6 +222,7 @@
 
      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') }}"
 

	
roles/xmpp_server/tasks/main.yml
Show inline comments
 
@@ -26,8 +26,10 @@
 

	
 
- 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:
roles/xmpp_server/tests/test_default.py
Show inline comments
 
@@ -5,15 +5,15 @@ 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):
roles/xmpp_server/tests/test_mandatory.py
Show inline comments
 
@@ -65,3 +65,11 @@ 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
 
@@ -71,3 +71,11 @@ 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)