Changeset - cc7de990e9e4
[Not reviewed]
0 6 0
Branko Majic (branko) - 5 years ago 2018-11-24 14:19:44
branko@majic.rs
MAR-138: Switch to using Prosody stable branch nightlies:

- Introduced additional parameter for specifying name of Prosody
package to install.
- Updated tests.
6 files changed with 24 insertions and 4 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/molecule/default/group_vars/parameters-optional.yml
Show inline comments
 
@@ -9,6 +9,7 @@ xmpp_domains:
 
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/molecule/default/tests/test_default.py
Show inline comments
 
@@ -7,15 +7,15 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
 
    os.environ['MOLECULE_INVENTORY_FILE']).get_hosts(['parameters-mandatory', 'parameters-optional'])
 

	
 

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

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

	
 

	
 
def test_prosody_apt_key(host):
roles/xmpp_server/molecule/default/tests/test_mandatory.py
Show inline comments
 
@@ -73,3 +73,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(host):
 
    """
 
    Tests if correct Prosody package has been installed.
 
    """
 

	
 
    assert host.package('prosody-0.10').is_installed
roles/xmpp_server/molecule/default/tests/test_optional.py
Show inline comments
 
@@ -79,3 +79,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(host):
 
    """
 
    Tests if correct Prosody package has been installed.
 
    """
 

	
 
    assert host.package('prosody-0.9').is_installed
roles/xmpp_server/tasks/main.yml
Show inline comments
 
@@ -26,8 +26,10 @@
 

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

	
 
- name: Allow Prosody user to traverse the directory with TLS private keys
 
  user:
0 comments (0 inline, 0 general)