diff --git a/roles/xmpp_server/molecule/default/prepare.yml b/roles/xmpp_server/molecule/default/prepare.yml index b10bb09c68c0fb4b0074108c98c760dec1abc165..d110337e00d0931a7a3ac4d8c7685637bb91b61c 100644 --- a/roles/xmpp_server/molecule/default/prepare.yml +++ b/roles/xmpp_server/molecule/default/prepare.yml @@ -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: diff --git a/roles/xmpp_server/molecule/default/tests/test_default.py b/roles/xmpp_server/molecule/default/tests/test_default.py index 7c28208c3ad596ba98bd394877708ce68f447ad3..014208a029f5df7fd3e8c7d80a4655eb8b09f7b8 100644 --- a/roles/xmpp_server/molecule/default/tests/test_default.py +++ b/roles/xmpp_server/molecule/default/tests/test_default.py @@ -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. diff --git a/roles/xmpp_server/molecule/default/tests/test_deprecated.py b/roles/xmpp_server/molecule/default/tests/test_deprecated.py index 7f5275b1ce6709f94db9f23d1d1c843b39e4f1d7..819a1a5b2531bb9d845ed7e3aedb85e12c6635b5 100644 --- a/roles/xmpp_server/molecule/default/tests/test_deprecated.py +++ b/roles/xmpp_server/molecule/default/tests/test_deprecated.py @@ -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 diff --git a/roles/xmpp_server/tasks/main.yml b/roles/xmpp_server/tasks/main.yml index afcf4c400d2ec459ba4523d4a35ef208bbf53c3f..ed6b45a5bdf1f11d1993bc6bf7046547b062a378 100644 --- a/roles/xmpp_server/tasks/main.yml +++ b/roles/xmpp_server/tasks/main.yml @@ -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"