|
|
---
|
|
|
|
|
|
# Ansible pre-requisites
|
|
|
# ======================
|
|
|
|
|
|
- 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) # noqa 503
|
|
|
# [503] Tasks that run when changed should likely be handlers
|
|
|
# Since apt_repository module is not reliable (does not deploy
|
|
|
# change when changing distro version etc), we have to use
|
|
|
# template instead, but this also means we need to trigger the apt
|
|
|
# cache reload by hand.
|
|
|
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
|
|
|
# Deprecation
|
|
|
# ===========
|
|
|
|
|
|
- name: Drop directory for storing custom Prosody modules (deprecation)
|
|
|
- name: Drop directory for storing custom Prosody modules
|
|
|
file:
|
|
|
path: "/usr/local/lib/prosody/"
|
|
|
state: absent
|
|
@@ -76,6 +56,45 @@
|
|
|
repo: "deb http://packages.prosody.im/debian {{ ansible_distribution_release }} main"
|
|
|
state: absent
|
|
|
|
|
|
# Remove the repository configuration file based on path as well, just
|
|
|
# to be on the safe side (in case the file was manually modified, and
|
|
|
# did not get detected properly by apt_repository module).
|
|
|
- name: Remove Prosody project-provided repository (double-tap)
|
|
|
file:
|
|
|
path: "/etc/apt/sources.list.d/packages_prosody_im_debian.list"
|
|
|
state: absent
|
|
|
|
|
|
|
|
|
# Main implementation
|
|
|
# ===================
|
|
|
|
|
|
- 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) # noqa 503
|
|
|
# [503] Tasks that run when changed should likely be handlers
|
|
|
# Since apt_repository module is not reliable (does not deploy
|
|
|
# change when changing distro version etc), we have to use
|
|
|
# template instead, but this also means we need to trigger the apt
|
|
|
# cache reload by hand.
|
|
|
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: Install additional Prosody dependencies
|
|
|
apt:
|
|
|
name:
|