Changeset - 065740010e44
[Not reviewed]
0 4 0
Branko Majic (branko) - 5 months ago 2023-11-19 16:53:27
branko@majic.rs
MAR-181: Drop deprecated directory for storing the LDAP auth module for Prosody.
4 files changed with 26 insertions and 49 deletions:
0 comments (0 inline, 0 general)
roles/xmpp_server/molecule/default/prepare.yml
Show inline comments
 
@@ -154,6 +154,14 @@
 
        name: prosody-0.11
 
        state: present
 

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

	
 
- hosts: clients
 
  become: true
 
  tasks:
roles/xmpp_server/molecule/default/tests/test_default.py
Show inline comments
 
@@ -29,35 +29,6 @@ def test_prosody_user(host):
 
    assert 'ssl-cert' in host.user('prosody').groups
 

	
 

	
 
def test_prosody_modules_directory(host):
 
    """
 
    Tests if directory for storing additional Prosody modules is set-up
 
    correctly.
 
    """
 

	
 
    directory = host.file('/usr/local/lib/prosody/modules')
 

	
 
    assert directory.is_directory
 
    assert directory.user == 'root'
 
    assert directory.group == 'root'
 
    assert directory.mode == 0o755
 

	
 

	
 
def test_prosody_mod_auth_ldap(host):
 
    """
 
    Tests if Prosody module mod_auth_ldap has been deployed correctly.
 
    """
 

	
 
    module = host.file('/usr/local/lib/prosody/modules/mod_auth_ldap.lua')
 

	
 
    assert module.is_file
 
    assert module.user == 'root'
 
    assert module.group == 'root'
 
    assert module.mode == 0o644
 
    assert 'module:provides("auth", provider);' in module.content_string
 
    assert 'mod_auth_ldap' in module.content_string
 

	
 

	
 
def test_prosody_configuration_file(host):
 
    """
 
    Tests if Prosody configuration file has correct permissions.
roles/xmpp_server/molecule/default/tests/test_deprecated.py
Show inline comments
 
@@ -155,3 +155,14 @@ def test_prosody_repository_is_absent(host):
 
    """
 

	
 
    assert not host.file("/etc/apt/sources.list.d/packages_prosody_im_debian.list").exists
 

	
 

	
 
def test_prosody_modules_directory_is_absent(host):
 
    """
 
    Tests if directory for storing deprecated Prosody modules has been
 
    correctly removed.
 
    """
 

	
 
    directory = host.file('/usr/local/lib/prosody/')
 

	
 
    assert not directory.exists
roles/xmpp_server/tasks/main.yml
Show inline comments
 
@@ -26,6 +26,13 @@
 
    group: root
 
    mode: 0644
 

	
 
- name: Drop directory for storing custom Prosody modules (deprecation)
 
  file:
 
    path: "/usr/local/lib/prosody/"
 
    state: absent
 
  notify:
 
    - Restart Prosody
 

	
 
- name: Collect information about installed packages
 
  package_facts:
 

	
 
@@ -140,26 +147,6 @@
 
    group: root
 
    mode: 0644
 

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

	
 
- name: Deploy the Prosody mod_auth_ldap module
 
  get_url:
 
    url: "https://hg.prosody.im/prosody-modules/raw-file/tip/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: 0644
 

	
 
- name: Deploy Prosody configuration file
 
  template:
 
    src: "prosody.cfg.lua.j2"
0 comments (0 inline, 0 general)