Changeset - 31a7f7c61740
[Not reviewed]
1 3 2
Branko Majic (branko) - 2 years ago 2023-11-19 12:21:02
branko@majic.rs
MAR-181: Install Prosody from Debian backports repository:

- This way we should be able to get way more features available, and
reduce chances of breaking upgrades from upstream project towards
Debian-provided packages due to eventual bigger differences between
the nightly builds and official releases.
6 files changed with 70 insertions and 9 deletions:
0 comments (0 inline, 0 general)
docs/releasenotes.rst
Show inline comments
 
@@ -25,12 +25,15 @@ run applications using Debian-only repositories.
 
  * Drop dependency on the external (Prosody) package
 
    repository. Install everything using official Debian
 
    repositories. This should help avoid future issues with Prosody
 
    project removing older versions of packages or dropping entire
 
    repository archives for older Debian releases.
 

	
 
  * Prosody package and some of its dependencies are installed from
 
    Debian backports to get more featureful release installed.
 

	
 

	
 
6.0.0
 
-----
 

	
 
Added support for Debian 10 (Buster), alongside a couple of minor
 
changes and features/improvements.
roles/xmpp_server/molecule/default/tests/test_default.py
Show inline comments
 
@@ -298,11 +298,47 @@ def test_prosody_certificate_checker_crontab(host):
 
    assert crontab.group == 'root'
 
    assert crontab.mode == 0o644
 
    assert "MAILTO=root" in crontab.content_string
 
    assert "/usr/local/bin/check_prosody_certificate.sh" in crontab.content_string
 

	
 

	
 
def test_backports_repository(host):
 
    """
 
    Tests if the backports repository has been configured.
 
    """
 

	
 
    repository = host.file("/etc/apt/sources.list.d/backports.list")
 

	
 
    distribution_release = host.ansible("setup")["ansible_facts"]["ansible_distribution_release"]
 
    expected_content = "deb http://deb.debian.org/debian %s-backports main" % distribution_release
 

	
 
    assert repository.is_file
 
    assert repository.user == "root"
 
    assert repository.group == "root"
 
    assert repository.mode == 0o644
 
    assert repository.content_string.rstrip() == expected_content
 

	
 

	
 
def test_backports_prosody_pinning(host):
 
    """
 
    Tests if the backports pin for Prosody has been deployed correctly.
 
    """
 

	
 
    pin = host.file("/etc/apt/preferences.d/prosody")
 

	
 
    assert pin.is_file
 
    assert pin.user == "root"
 
    assert pin.group == "root"
 
    assert pin.mode == 0o644
 

	
 
    prosody_package = host.package("prosody")
 
    lua_ldap_package = host.package("lua-sec")
 

	
 
    assert "bpo" in prosody_package.version
 
    assert "bpo" in lua_ldap_package.version
 

	
 

	
 
# @TODO: Tests which were not implemented due to lack of out-of-box tools:
 
#
 
# - Proxy capability.
 
# - MUC.
 
# - Server administration through XMPP.
roles/xmpp_server/tasks/main.yml
Show inline comments
 
---
 

	
 
- name: Install Python apt bindings
 
  apt:
 
    name: python-apt
 

	
 
- name: Set-up the Debian backports repository
 
  template:
 
    src: backports.list.j2
 
    dest: /etc/apt/sources.list.d/backports.list
 
    owner: root
 
    group: root
 
    mode: 0644
 
  register: backports_repository_configuration
 

	
 
- name: Update apt cache if backports repository configuration changed (for immediate use)
 
  apt:
 
    update_cache: true
 
  when: backports_repository_configuration.changed
 

	
 
- name: Configure package pins to backports for Prosody
 
  template:
 
    src: prosody_backports_pin.j2
 
    dest: /etc/apt/preferences.d/prosody
 
    owner: root
 
    group: root
 
    mode: 0644
 

	
 
- name: Collect information about installed packages
 
  package_facts:
 

	
 
- name: Uninstall Prosody from project-provided repository
 
  apt:
 
    name: prosody
roles/xmpp_server/templates/backports.list.j2
Show inline comments
 
new file 100644
 
deb http://deb.debian.org/debian {{ ansible_distribution_release }}-backports main
roles/xmpp_server/templates/lua_ldap_backports_pin.j2
Show inline comments
 
deleted file
roles/xmpp_server/templates/prosody_backports_pin.j2
Show inline comments
 
new file 100644
 
#
 
# Pins Prosody and some related packages to Debian backports in order
 
# to get more up-to-date features and bug/security updates.
 
#
 

	
 
Package: prosody lua-sec
 
Pin: release a={{ ansible_distribution_release }}-backports
 
Pin-Priority: 600
0 comments (0 inline, 0 general)