Changeset - b3e67fd6c0c1
[Not reviewed]
0 3 0
Branko Majic (branko) - 10 months ago 2023-11-26 15:48:38
branko@majic.rs
MAR-187: Reorder the deprecation tasks for xmpp_server role to make the runs reliable:

- Deprecated apt repository really needs to be removed first in case
it has an unresolvable URL (so the backports repository cache update
would trigger correctly).
- Use the file removal for Prosody repository as well to make sure the
file is dropped.
3 files changed with 68 insertions and 26 deletions:
0 comments (0 inline, 0 general)
docs/releasenotes.rst
Show inline comments
 
Release notes
 
=============
 

	
 

	
 
x.y.z
 
-----
 

	
 
Minor bug-fixes.
 

	
 
**Bug fixes:**
 

	
 
* ``xmpp_server`` role
 

	
 
  * Make sure to take care of deprecation-related package and
 
    configuration removals prior to running the rest of the tasks to
 
    avoid errors relaetd to deprecated elements being invalid (like
 
    repository URLs for Prosody).
 

	
 

	
 
7.0.0
 
-----
 

	
 
Dropped support for Debian 9 (Stretch), moved away from using
 
non-Debian project repositories (like Prosody ones).
 

	
 
**Breaking changes:**
 

	
 
* All roles
 

	
 
  * Dropped support for Debian 9 (Stretch).
 

	
 
* ``xmpp_server`` role
 

	
 
  * Parameter ``xmpp_prosody_package`` has been dropped.
 

	
 
**New features/improvements**
 

	
 
* ``common`` role
 

	
 
  * Added parameters ``pip_check_requirements_in`` and
 
    ``pip_check_requirements_py3_in`` that can be used for specifying
 
    input requirements when checking for available package upgrades
 
    for Python virtual environments that are used for the checks
 
    themselves. This is particularly helpful in cases where Python
 
    version gets deprecated and some packages do not correctly declare
 
    the minimum version required, allowing to be more specific to
 
    avoid unnecessary warning mails being sent out.
 

	
 
  * Updated default package pins for virtual environments used to
 
    check for available pip package upgrades.
 

	
 
* ``mail_server`` role
 

	
 
  * Added parameter ``mail_server_smtp_additional_configuration`` that
 
    provides ability to include additional configuration directives
 
    for the SMTP server.
 

	
 
* ``xmpp_server`` role
 

	
 
  * 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.
 

	
 
  * Role no longer depends on fetching external Prosody modules from
 
    project code repository, and instead relies on the prosody-modules
 
    package for LDAP authentication module.
 

	
 

	
 
6.0.0
 
-----
 

	
 
Added support for Debian 10 (Buster), alongside a couple of minor
 
changes and features/improvements.
 

	
 
**Breaking changes:**
 

	
 
* ``ldap_server`` role
 

	
 
  * Use 2048-bit Diffie-Hellman parameters for relevant TLS
 
    ciphers. This could introduce incompatibility with older
 
    clients/servers trying to connect to the LDAP server. This change
 
    is applicable only under Debian Buster.
 

	
 
**New features/improvements:**
 

	
 
* All roles
 

	
 
  * Added support for Debian 10 (Buster).
 

	
 
* ``common`` role
 

	
 
  * Added parameters ``maintenance`` and ``maintenance_allowed_hosts``
 
    for enabling maintenance mode. In maintenance mode only the listed
 
    hosts are allowed to connect to the server.
 

	
 
**Bug fixes:**
 

	
 
* ``ldap_server`` role
 

	
 
  * Allow use of DHE TLS ciphers by generating the necessary
 
    Diffie-Hellman parameters. This bug fix is applicable only under
 
    Debian Buster.
 

	
 
* ``wsgi_website_`` role
 

	
 
  * When the virtual environment is created, the ``setuptools`` and
 
    ``pip`` packages will not get pinned to any specific version,
 
    allowing roles that are based on ``wsgi_website`` to easily
 
    install preferred versions, and avoid idempotence problems in the
 
    process.
 

	
 

	
 
5.0.0
 
-----
 

	
 
Upgrade to Ansible 2.9.x, dropping support for Debian 8 Jessie,
 
upgrade to Python 3.x, dropping support for Python 2.7. A number of
 
parameters have been made mandatory or deprecated. Security has been
 
slightly improved in a number of roles, and there is plenty of
 
bug-fixes and minor improvements throughout as well.
 

	
 
**Breaking changes:**
 

	
 
* Switched to Ansible 2.9.x, removing support for older versions. All
 
  documentation has been updated.
 
* Switched to using Python 3 on both controller and managed server
 
  side. Python 2.7 can no longer be used for this purpose. Support for
 
  WSGI applications running on Python 2.7 remains.
 

	
 
* All roles
 

	
 
  * Support for Debian 8 Jessie has been dropped.
 
  * Common parameters ``tls_private_key_dir`` and
 
    ``tls_certificate_dir`` are no longer used.
 
  * TLS private key and certificate parameters are now mandatory.
 

	
 
* ``bootstrap`` role
 

	
 
  * Parameter ``ansible_key`` is now mandatory.
 

	
 
* ``common`` role``
 

	
 
  * Minimum version of ``pip-tools`` in the ``pip_check_requirements``
 
    and ``pip_check_requirements_py3`` is now 5.3.0. This change was
 
    required in order to fix the deprecation warnings being sent out
 
    when the ``pip_check_requirements_upgrades.sh`` script is run.
 

	
 
* ``database_server`` role
 

	
 
  * Parameter ``db_root_password`` has been deprecated. The root user
 
    can now login into the database (as the root database user) via
 
    unix socket authentication.
 

	
 
  * Role will drop the use of Debian system maintenance user
 
    (``debian-sys-maint``) in favour of using the root account with
 
    UNIX socket authentication if the database server has not already
 
    been set-up in that manner. This is the default behaviour starting
 
    from Debian Stretch, and the ``debian-sys-main`` will be present
 
    only if the server has been upgraded from older releases.
 

	
 
* ``ldap_server`` role
 

	
 
  * Parameter ``ldap_server_domain`` is now mandatory.
 

	
 
  * Updated default set of TLS ciphers used by server
 
    (``ldap_tls_ciphers`` parameter). All CBC ciphers have been
 
    dropped. This could introduce incompatibility with older clients
 
    trying to connect to the LDAP server.
 

	
 
* ``mail_forwarder`` role
 

	
 
  * Use 2048-bit Diffie-Hellman parameters for relevant TLS
 
    ciphers. This could introduce incompatibility with older
 
    clients/servers trying to connect to the SMTP server.
 

	
 
* ``mail_server`` role
 

	
 
  * Use 2048-bit Diffie-Hellman parameters for relevant TLS
 
    ciphers. This could introduce incompatibility with older
 
    clients/servers trying to connect to the SMTP/IMAP server.
 

	
 
  * Updated default set of TLS ciphers used by IMAP/SMTP servers
 
    (``mail_server_tls_ciphers`` parameter). All CBC ciphers have been
 
    dropped. This could introduce incompatibility with older clients
 
    trying to connect to the IMAP/SMTP server.
 

	
 
  * Dropped the use of ``procmail`` for local mail deliveries.
 

	
 
* ``php_website`` role
 

	
 
  * Parameter ``enforce_https`` has been deprecated and
 
    removed. HTTPS is now mandatory in all cases.
 

	
 
* ``preseed`` role
 

	
 
  * Parameter ``ansible_key`` is now mandatory.
 

	
 
  * Parameter ``preseed_directory`` is now mandatory.
 

	
 
* ``web_server`` role
 

	
 
  * Use 2048-bit Diffie-Hellman parameters for relevant TLS
 
    ciphers. This could introduce incompatibility with older clients
 
    trying to connect to the web server.
 

	
 
  * Updated default set of TLS ciphers used by the server
 
    (``web_server_tls_ciphers`` parameter). All CBC ciphers have been
 
    dropped. This could introduce incompatibility with older clients
 
    trying to connect to the server.
 

	
 
  * Parameter ``default_enforce_https`` has been deprecated and
 
    removed. HTTPS is now mandatory in all cases.
 

	
 
* ``wsgi_website`` role
 

	
 
  * Parameters ``gunicorn_version`` and ``futures_version`` have been
 
    deprecated and removed. Existing roles should be updated to
 
    utilise the ``wsgi_requirements`` parameter instead.
 

	
 
  * Parameter ``enforce_https`` has been deprecated and
 
    removed. HTTPS is now mandatory in all cases.
 

	
 
  * Added parameter ``wsgi_requirements_in`` for listing top-level
 
    packages for performing pip requirements upgrade checks for
 
    Gunicorn requirements (listed via existing ``wsgi_requirements``
 
    parameter).
 

	
 
* ``xmpp_server`` role
 

	
 
  * Parameter ``xmpp_domains`` is now mandatory.
 

	
 
  * Use 2048-bit Diffie-Hellman parameters for relevant TLS
 
    ciphers. This could introduce incompatibility with older
 
    clients/servers trying to connect to the XMPP server.
 

	
 
  * TLS hardening is now applied to the *c2s* (client) connections on
 
    both the standard (``5222``) and legacy (``5223``) ports. Protocol
 
    version and ciphers are configurable via new
 
    ``xmpp_server_tls_protocol`` and ``xmpp_server_tls_ciphers``
 
    parameters with defaults enforcing TLSv1.2+ and PFS (perfect
 
    forward secrecy) ciphers.
 

	
 
  * Support for older Prosody versions (``0.9.x``) has been
 
    dropped. Only Prosody ``0.10.x`` is supported at the moment (due
 
    to missing Lua LDAP bindings in Debian 9 Stretch).
 

	
 
  * Support for running Prosody 0.11.x has been added. This is also
 
    the new default version of Prosody that gets deployed to the
 
    target system.
 

	
 
**Bug fixes:**
 

	
 
* ``common`` role
 

	
 
  * Run apticron at least once during initial installation to avoid
 
    accidental locking later on during the same playbook run.
 

	
 
* ``mail_server`` role
 

	
 
  * Fixed the problem with the SMTP server (Postfix) not using TLS at
 
    all for outgoing SMTP connections. The server will now default to
 
    using opportunistic TLS (using TLS where available).
 

	
 
* ``wsgi_website`` role
 

	
 
  * Deploy the requirement files used for upgrade checks to correct
 
    location when using Python 3. Previously the files would get
 
    deployed to directory dedicated to Python 2 version, which means
 
    the checks would be performed using Python 2 instead of Python 3.
 

	
 
**New features/improvements:**
 

	
 
* Tests have been updated to work with latest Molecule/Testinfra as
 
  part of the Ansible upgrade process.
 
* X.509 artefacts used during testing are now generated on the fly
 
  using `Gimmecert <https://gimmecert.readthedocs.io/>`_.
 

	
 
* ``mail_forwader`` role
 

	
 
  * The role now supports specifying the maximum mail message size
 
    limit for the SMTP server to accept via
 
    ``mail_message_size_limit`` role parameter.
 

	
 
  * Mail server configuration has been slightly updated to better
 
    match what is currently the defaults in Debian Stretch.
 

	
 
* ``mail_server`` role
 

	
 
  * The role now supports specifying the maximum mail message size
 
    limit for the SMTP server to accept via
 
    ``mail_message_size_limit`` role parameter.
 

	
 
  * Mail server configuration has been slightly updated to better
 
    match what is currently the defaults in Debian Stretch.
 

	
 
* ``xmpp_server`` role
 

	
 
  * Server now supports blocking users via `XEP-0191: Blocking Command
 
    <https://xmpp.org/extensions/xep-0191.html>`_.
 
  * Server now supports `XEP-0280: Message Carbons
 
    <http://xmpp.org/extensions/xep-0280.html>`_, letting multiple
 
    online XMPP clients receive/store the same message.
 
  * Server now supports `XEP-0313: Message Archive Management
 
    <https://xmpp.org/extensions/xep-0313.html>`_, storing copies of
 
    received messages server-side. Message expiration is configurable
 
    via parameter ``xmpp_server_archive_expiration``.
 
  * XMPP server certificate is checked on daily basis using the
 
    ``prosodyctl check certs`` command. This helps catch issues where
 
    issued certificate does not include all the necessary subject
 
    alternative names (this has also been documented in the role
 
    reference documentation).
 

	
 
**Deprecations:**
 

	
 
* ``backup_server`` and ``backup_client`` role
 

	
 
  * Officially dropped support for DSA keys (this was mainly remnant
 
    from Debian 8 Jessie support, on Debian 9 Stretch and upwards the
 
    DSA keys were not supported at all).
 

	
 

	
 
4.0.0
 
-----
 

	
 
A couple of smaller bug-fixes, and introduction of (minor) breaking
 
change related to handling of pip requirements upgrade checks in the
 
``common`` role (see below).
 

	
 
Breaking changes:
 

	
 
* ``common`` role:
 

	
 
  * Added separate parameter (``pip_check_requirements_py3``) for
 
    specifying dedicated Python 3 virtual environment package
 
    requirements used for package upgrade checks on (other
 
    user-provided) Python 3 virtual environments. If the existing
 
    ``pip_check_requirements`` parameter has been overridden, the new
 
    parameter will most likely need to be overridden in your site
 
    configuration as well. Take note that the new requirements will
 
    differ between Debian Jessie and Debian Stretch due to differnece
 
    in Python 3 minor version releases.
 

	
 
Bug fixes:
 

	
 
* ``backup_client`` role
 

	
 
  * Avoid errors related to lack of ``tty`` when invoking the GnuPG
 
    utility by using the ``--no-tty`` option.
 

	
 
* ``common`` role
 

	
 
  * Fixed problem with pip requirements upgrades checks outputting
 
    package list to stderr, causing the cron job to report outdated
 
    packages to administrator even though nothing is outdated (cron
 
    job treats anything output to stderr as worthy of notification).
 

	
 

	
 
3.1.0
 
-----
 

	
 
Minor improvements and fixes.
 

	
 
Breaking changes:
 

	
 
* ``common`` role:
 

	
 
   * Default values for the ``pip_check_requirements`` have changed to
 
     include ``pip`` and ``setuptools`` (and a couple more). It might
 
     be necessary to update any customised values of this parameter to
 
     match the default set of packages.
 

	
 
Bug fixes:
 

	
 
* ``common`` role
 

	
 
  * Use Python 3 in Python virtual environment used for checking if
 
    upgrades are available for Python requirements files. Fixes
 
    possibly incorrect package resolution due to wrong version of
 
    Python (for packages that have different dependencies based on
 
    Python version).
 

	
 
New features/improvements:
 

	
 
* ``common`` role
 

	
 
  * Changed how the packages are installed in Python virtual
 
    environments used for performing pip requirements upgrade checks,
 
    making the process more reliable. The packages in those dedicated
 
    environments are now fully pinned, including system packages such
 
    as ``setuptools`` and ``pip`` itself.
 

	
 
  * Changed the pip requirements checks to now take into account
 
    unsafe packages as well (such as ``setuptools`` and ``pip``) if
 
    listed.
 

	
 

	
 
3.0.0
 
-----
 

	
 
Upgrade to Ansible 2.7.x and full support for Debian 9 (Stretch).
 

	
 
Breaking changes:
 

	
 
* Switched to Ansible 2.7.x, removing support for older versions. All
 
  documentation has been updated.
 

	
 
* All roles
 

	
 
  * In order to avoid collision with reserved name, the variable for
 
    running the handlers explicitly has been changed from ``handlers``
 
    to ``run_handlers``. E.g. to run all handlers a command similar to
 
    ``ansible-playbook -t handlers -e run_handlers=true
 
    playbooks/site.yml`` should be used.
 

	
 
* ``ldap_server`` role
 

	
 
  * Custom LDAP module ``m_ldap_entry`` has been removed. Role uses
 
    the official ``ldap_entry`` and ``ldap_attr`` modules.
 

	
 
  * The ``ldap_entries`` parameter now supports only the states
 
    supported by ``ldap_entry`` module (e.g. ``append`` is not
 
    supported any longer - since it came with custom LDAP module).
 

	
 
* ``xmpp_server`` role
 

	
 
  * Installs Prosody nightly builds (default version 0.10) instead of
 
    latest stable. Change made to improve reproducability, and to
 
    avoid future breakages after new major/minor releases of
 
    Prosody. Prosody package name can be specified through the
 
    ``xmpp_prosody_package`` variable.
 

	
 
    This should most likely not break anything, but is included as
 
    possibly breaking change nevertheless since it is a big change in
 
    how Prosody is installed.
 

	
 
    This change had to be done because LDAP integration broke with
 
    Prosody 0.11 due to missing LDAP bindings for Lua 5.2. See
 
    `MAR-137: XMPP server LDAP integration not working for Prosody
 
    0.11.x
 
    <https://projects.majic.rs/majic-ansible-roles/issues/MAR-137>`_
 
    for more details.
 

	
 
New features/improvements:
 

	
 
* Tests have been updated to work with latest Molecule/Testinfra as
 
  part of the Ansible upgrade process.
 

	
 
* All roles
 

	
 
  * Full support for Debian 9 (Stretch) has been added to all roles.
 

	
 
* ``common`` role
 

	
 
  * The ``pip`` requirements upgrade checks are now performed once per
 
    day instead of once per hour.
 
  * The ``pip`` requirements upgrade checks now do not output warning
 
    in case deployed ``.in`` file does not have a matching ``.txt``
 
    file.
 
  * Certificate expiration check is less verbose. No mails are sent
 
    out any longer in case no certificates have been configured for
 
    checking, nor in cases where all certificates have passed the
 
    check. E.g. mails are sent out only in case some of the configured
 
    certificates will expire within next 30 days.
 

	
 
* ``wsgi_website`` role
 

	
 
  * Support for specifying Python version for Python virtual
 
    environment.
 

	
 

	
 
2.0.0
 
-----
 

	
 
Upgrade to Ansible 2.3.x, minor bug fixes and updates needed for the upgrade.
 

	
 
Breaking changes:
 

	
 
* Switched to Ansible 2.3.x, removing support for Ansible 1.9.x. All
 
  documentation has been updated.
 

	
 
* Due to switch to Ansible 2.x which is more restrictive when deploying code on
 
  remote server, it is now necessary to use one of the methods listed in
 
  `Ansible documentation
 
  <https://docs.ansible.com/ansible/latest/become.html#becoming-an-unprivileged-user>`_
 
  if connecting to remote server as user other than ``root``. Easiest fix is to
 
  enable ``pipelining``. Tests have been already updated to take advantage of
 
  this.
 

	
 
* ``ldap_server`` role
 

	
 
   * Renamed ``ldap_entry`` module to ``m_ldap_entry`` to avoid collision with
 
     official module.
 
   * Renamed ``ldap_permissions`` module to ``m_ldap_permissions`` to be
 
     consistent and to avoid potential future collisions with official module
 
     names.
 

	
 
* ``wsgi_website`` role
 

	
 
   * Removed handler with parametrised name used for restarting the web
 
     service. Dependent roles should instead define their own handlers from now
 
     on.
 

	
 
New features/improvements:
 

	
 
* Updated documentation to refer to Debian Jessie documentation where necessary.
 

	
 
* ``ldap_server`` role
 

	
 
  * Updated tests to be more resilient to ordering changes.
 

	
 
* ``mail_forwarder`` role
 

	
 
  * Updated tests to be more resilient to ordering changes and time races.
 

	
 
* ``backup_client`` role
 

	
 
  * Switched to using the ``file`` module when cleaning-up GnuPG backup keyring,
 
    which should make it more robust..
 

	
 
Bug-fixes:
 

	
 
* Updated pip requirements and its input file to include ``python-vagrant``
 
  (needed for Molecule tests).
 

	
 
* Updated handling of key ID extraction for OpenPGP keys in order for it to work
 
  with Ansible 2.x.
 

	
 
* Updated usage instructions in order to be able to install The Bug Genie via
 
  script, and added missing instructions for creating one of the directories for
 
  the demo wiki role (``handlers`` directory).
 

	
 
* All roles
 

	
 
  * Updated test playbooks to avoid idempotence test failures due to apt cache
 
    updates.
 

	
 
* ``backup_client`` role
 

	
 
  * Fixed scenario in which backup keys could not be properly replaced on Debian
 
    Stretch machines (due to more up-to-date version of GnuPG compared to Debian
 
    Jessie).
 

	
 
* ``common`` role
 

	
 
  * Fixed handling of complex version specifications when installing packages
 
    via pip. Needed for Ansible 2.x.
 

	
 
* ``wsgi_website`` role
 

	
 
  * Fixed handling of complex version specifications when installing packages
 
    via pip. Needed for Ansible 2.x.
 
  * Fixed erroneous calculation of adminstrator username in internal
 
    defaults parameter.
 

	
 

	
 
1.7.0
 
-----
 

	
 
Minor improvements for mail-related roles, internal refactoring of task syntax,
 
and improvements of tests.
 

	
 
New features/improvements:
 

	
 
* Documentation
 

	
 
  * Added new sub-section in development section describing some of the
 
    conventions used while developing the roles.
 

	
 
* All roles
 

	
 
  * Switched to using expanded syntax in all roles and cleaned-up the tasks a
 
    bit (mainly internal change).
 
  * Minor cleanups within tests and tasks to accomodate the syntax changes
 
    (mainly internal change).
 

	
 
* ``mail_forwarder`` role
 

	
 
  * Added parameter ``smtp_from_relay_allowed`` that controls if managed machine
 
    should accept incoming SMTP connections from the relay server. Useful for
 
    NAT'ed or laptop machines.
 
  * Added parameter ``smtp_relay_host_port`` that controls what port is used for
 
    connecting to the specified SMTP relay. Useful for machines behind
 
    restrictive ISPs.
 

	
 
* ``mail_server`` role
 

	
 
  * Introduced firewall rules to redirect from TCP port 27 to TCP port 25,
 
    useful for machines behind restrictive ISPs.
 

	
 

	
 
1.6.0
 
-----
 

	
 
Implemented full test suite with a plethora of smaller bug-fixes, and some minor
 
(internal) improvements.
 

	
 
Breaking changes:
 

	
 
* All roles
 

	
 
  * Previously a number of roles would modify permissions on the ``/srv``
 
    directory. This has now been fixed in order to prevent weird backup failures
 
    etc. Manual intervention is necessary on existing servers to fix the issue
 
    by changing the mode to ``0755`` (this is the usual default upon the OS
 
    installation).
 

	
 
* ``mail_server`` role
 

	
 
  * Since Postfix will now fall-back to using ``/etc/hosts`` if it cannot
 
    resovle a domain via DNS, some special care may be needed in case you have
 
    some unusual entries in ``/etc/hosts``. Normally this should not be an
 
    issue, though.
 

	
 
* ``backup_client`` role
 

	
 
  * Up to this point, if you had more than one additional encryption key
 
    specified in configuration, only the first one was taken into account. This
 
    is a major issue since it would render backups up to this point decryptable
 
    only with one of the keys. It is highly suggested to perform a full backup
 
    after upgrading to new version of Majic Ansible Roles via command::
 

	
 
      sudo duply main full
 

	
 
    This will ensure the most recent backup is decryptable with all additional
 
    keys!
 

	
 
New features/improvements:
 

	
 
* Added new documentation chapter dedicated to development.
 
* Added ``requirements.txt`` that can be used for installing the required
 
  packages in virtual environment (useful for development).
 
* Small fixes (mostly typos and such) throughout the documentation.
 

	
 
* All roles
 

	
 
  * Implemented tests using Molecule. See documentation for instructions on how
 
    to run tests.
 
  * Small internal refactorings to make things simpler and easier to maintain.
 

	
 
* ``common`` role
 

	
 
  * Added missing documentation for parameters ``pipreqcheck_uid`` and
 
    ``pipreqcheck_gid``.
 

	
 
* ``mail_server`` role
 

	
 
  * Updated Postfix configuration to fall-back to using ``/etc/hosts`` if DNS
 
    lookup fails. This allows for more flexibility when testing and deploying if
 
    proper DNS is not available.
 

	
 
Bug-fixes:
 

	
 
* All roles
 

	
 
  * Fixed how TLS key and certificate material is deployed in order to avoid
 
    mangling of tabs.
 
  * Fixed how file modes are specified in tasks to ensure correct permissions
 
    are applied.
 
  * Fixed missing ``become`` keyword in tasks that use ``become_user`` for
 
    consistent execution.
 

	
 
* ``backup_client`` role
 

	
 
  * Fixed configuration (and documentation) for specifying the backup server
 
    URI - previous implementation included too many forward slashes which could
 
    cause failures in case of custom SSH server being used for backup.
 
  * Fixed configuration of additional encryption keys to include all keys listed
 
    instead of just the first one.
 
  * Fixed issue with ``backup_server_port`` parameter being completely ignored
 
    in the configuration.
 
  * Fixed issue with missing ``/etc/duply/main/include`` configuration file in
 
    case no backup patterns are deployed.
 

	
 
* ``backup_server`` role
 

	
 
  * Fixed deployment of backup server SSH keys in order to avoid unusable
 
    ``ed25519`` keys.
 

	
 
* ``common`` role
 

	
 
  * Fixated version of ``pip`` installed for performing Pyhton requirements
 
    package upgrade checks.
 
  * Fixed incorrect documentation for parameter ``additional_groups``.
 
  * Fixed ownership setting for firewall configuration file.
 
  * Fixed script used for performing checks on pip requirementes files for
 
    availalbe package upgrades. False positives due to different sorting will
 
    not be reported anymore, and the script will actually make sure to check if
 
    upgrades are available (which was not the case before due ot missing
 
    paramter to pip-compile).
 

	
 
* ``ldap_server`` role
 

	
 
  * Fixed invalid configuration of LDAP server package via
 
    ``debconf-set-selections`` (wrong option was used for
 
    ``shared/organization``).
 
  * Fixed role documentation example for parameter ``ldap_entries`` (was using
 
    obsolete syntax of ``ldap_entry`` module).
 
  * When making changes to the LDAP server configuration, make sure to use Unix
 
    socket. This way the role does not depend on correct LDAP client
 
    configuration.
 

	
 
* ``mail_server`` role
 

	
 
  * Fixed Postfix main configuraiton file permissions set-up to be explicit.
 
  * Fixed issue where Postfix server is not restarted when the truststore (used
 
    for verifying the LDAP server certificate) is changed.
 
  * Fixed issue with Postfix configuration where the parameter ``mail_user`` was
 
    ignored when making deliveries to Dovecot (old implementation used fixed
 
    value of ``vmail`` instead of parameter).
 

	
 
* ``php_website`` role
 

	
 
  * Fixed Nginx configuration file to use correct parameter (``enforce_https``
 
    instead of ``default_enforce_https``) when configuring HSTS. Previously it
 
    was possible to set the parameter to ``no``, and still end-up with HSTS
 
    headers being set-up.
 

	
 
* ``wsgi_website`` role
 

	
 
  * Fixed Nginx configuration file to use correct parameter (``enforce_https``
 
    instead of ``default_enforce_https``) when configuring HSTS. Previously it
 
    was possible to set the parameter to ``no``, and still end-up with HSTS
 
    headers being set-up.
 

	
 
* ``xmpp_server`` role
 

	
 
  * Fixed invalid default value for paramerer ``xmpp_domains`` - it should be a
 
    list and not a simple string. Previously this would result in invalid domain
 
    set-up in Prosody configuration file.
 
  * Fixed issue with permissions not being set on Prosody configuration file,
 
    making it world-readable (the configuration file contains passwords).
 

	
 

	
 
1.5.1
 
-----
 

	
 
Small bug-fix release for misbehaving package upgrade checks.
 

	
 
Bug-fixes:
 

	
 
* ``common`` role
 

	
 
  * Fixed script used for performing checks on pip requirementes files for
 
    availalbe package upgrades. False positives due to different sorting will
 
    not be reported anymore, and the script will actually make sure to check if
 
    upgrades are available (which was not the case before due ot missing
 
    paramter to pip-compile).
 

	
 

	
 
1.5.0
 
-----
 

	
 
Minor bug-fixes, package upgrade checks, and better support for next Debian
 
stable release (Stretch).
 

	
 
New features/improvements:
 

	
 
* ``backup_client`` role
 

	
 
  * Implemented support for next Debian stable release (*Debian Stretch*). This
 
    was needed due to changes in duplicity parameters and their syntax.
 

	
 
* ``common`` role
 

	
 
  * Added parameter for configuring common backup patterns. Allows for better
 
    control over ``/root`` and ``/home`` directories. Backup of remaining
 
    directories is still hard-coded.
 
  * Added support for checking if package upgrades are available. Covers system
 
    packages out-of-the-box, and provides ability to perform checks on pip
 
    requirements files.
 
  * Added generic support for checking certificate expiration dates. Relevant
 
    roles need to deploy special configuration files to trigger the checks.
 

	
 
* ``ldap_server`` role
 

	
 
  * Updated role to perform certificate expiration date check on LDAP server
 
    certificate.
 

	
 
* ``mail_server`` role
 

	
 
  * Updated role to perform certificate expiration date check on all mail server
 
    certificates.
roles/xmpp_server/molecule/default/prepare.yml
Show inline comments
 
---
 

	
 
- name: Set-up fixtures
 
  hosts: localhost
 
  connection: local
 
  gather_facts: false
 
  tasks:
 

	
 
    - name: Initialise CA hierarchy
 
      command: "gimmecert init"
 
      args:
 
        creates: ".gimmecert/ca/level1.cert.pem"
 
        chdir: "tests/data/"
 

	
 
    - name: Generate server private keys and certificates
 
      command:
 
      args:
 
        chdir: "tests/data/"
 
        creates: ".gimmecert/server/{{ item.name }}.cert.pem"
 
        argv: "{{ ['gimmecert', 'server', item.name] + item.fqdn }}"
 
      with_items:
 
        - name: ldap-server_ldap
 
          fqdn:
 
            - ldap-server
 
        - name: parameters-mandatory-buster64_xmpp
 
          fqdn:
 
            - parameters-mandatory
 
            - domain1
 
            - proxy.domain1
 
            - conference.domain1
 
        - name: parameters-optional-buster64_xmpp
 
          fqdn:
 
            - parameters-optional
 
            - domain2
 
            - proxy.domain2
 
            - conference.domain2
 
            - domain3
 
            - proxy.domain3
 
            - conference.domain3
 
        - name: deprecated-buster64_xmpp
 
          fqdn:
 
            - deprecated
 
            - domain4
 
            - proxy.domain4
 
            - conference.domain4
 

	
 
    - name: Set-up link to generated X.509 material
 
      file:
 
        src: ".gimmecert"
 
        dest: "tests/data/x509"
 
        state: link
 

	
 
- name: Prepare
 
  hosts: all
 
  gather_facts: false
 
  tasks:
 
    - name: Install python for Ansible
 
      raw: test -e /usr/bin/python3 || (apt -y update && apt install -y python3-minimal)
 
      become: true
 
      changed_when: false
 

	
 
- hosts: all
 
  become: true
 
  tasks:
 

	
 
    - name: Update all caches to avoid errors due to missing remote archives
 
      apt:
 
        update_cache: true
 
      changed_when: false
 

	
 
    - name: Install tools for testing
 
      apt:
 
        name:
 
          - gnutls-bin
 
          - nmap
 
        state: present
 

	
 
    - name: Use name provided via CLI when running STARTTLS handshake for XMPP via nmap
 
      replace:
 
        path: "/usr/share/nmap/nselib/sslcert.lua"
 
        regexp: "host\\.name\\)"
 
        replace: "host.targetname)"
 

	
 
- hosts: buster
 
  become: true
 
  tasks:
 

	
 
    - name: Set-up the hosts file
 
      lineinfile:
 
        path: /etc/hosts
 
        regexp: "^{{ item.key }}"
 
        line: "{{ item.key }} {{ item.value }}"
 
        owner: root
 
        group: root
 
        mode: 0644
 
        state: present
 
      with_dict:
 
        192.168.56.10: "ldap-server backup-server"
 
        192.168.56.20: "client-buster"
 
        192.168.56.30: "parameters-mandatory domain1 proxy.domain1 conference.domain1"
 
        192.168.56.31: "parameters-optional domain2 proxy.domain2 conference.domain2 domain3 proxy.domain3 conference.domain3"
 
        192.168.56.32: "deprecated domain4 proxy.domain4 conference.domain4"
 

	
 
    - name: Enable TLSv1.0+ in global OpenSSL configuration file in order to be able to test the xmpp_server_tls_protocol parameter
 
      lineinfile:
 
        path: "/etc/ssl/openssl.cnf"
 
        regexp: "^MinProtocol ="
 
        line: "MinProtocol = TLSv1.0"
 
        owner: root
 
        group: root
 
        mode: 0644
 
        state: present
 

	
 
    # @WORKAROUND: Prosody repository override
 
    #
 
    # Prosody project has killed off Debian Buster repositories. Trick
 
    # the system to install packages from custom repository location
 
    # instead.
 
    - name: Override server IP for Prosody repository via hosts file
 
      lineinfile:
 
        path: /etc/hosts
 
        regexp:
 
        line: "{{ lookup('dig', 'prosody.repo.majic.rs') }} packages.prosody.im"
 
        owner: root
 
        group: root
 
        mode: 0644
 
        state: present
 
      tags:
 
        - workaround:prosody_repository_override
 

	
 
    - name: Add workaround Prosody repository signing key
 
      apt_key:
 
        data: "{{ lookup('file', 'workaround_prosody_repository_signing_key.asc') }}"
 
        state: present
 
      tags:
 
        - workaround:prosody_repository_override
 

	
 
- hosts: deprecated
 
  become: true
 
  tasks:
 

	
 
    - name: Add Prosody repository signing key
 
      apt_key:
 
        data: "{{ lookup('file', 'prosody-debian-gpg-key.asc') }}"
 
        state: present
 

	
 
    - name: Add Prosody repository
 
      apt_repository:
 
        repo: "deb http://packages.prosody.im/debian {{ ansible_distribution_release }} main"
 
        state: present
 

	
 
    - name: Install Prosody (from Prosody repository)
 
      apt:
 
        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
 

	
 
    - name: Invalidate the Prosody repository URL for testing if the file gets dropped at correct time during initial converge
 
      copy:
 
        content: "deb http://invalidname/debian buster main"
 
        dest: "/etc/apt/sources.list.d/packages_prosody_im_debian.list"
 
        owner: root
 
        group: root
 
        mode: 0644
 

	
 
- hosts: clients
 
  become: true
 
  tasks:
 

	
 
    - name: Install tool for testing TCP connectivity
 
      apt:
 
        name: hping3
 
        state: present
 

	
 
    - name: Deploy CA certificate
 
      copy:
 
        src: tests/data/x509/ca/level1.cert.pem
 
        dest: /usr/local/share/ca-certificates/testca.crt
 
        owner: root
 
        group: root
 
        mode: 0644
 
      notify:
 
        - Update CA certificate cache
 

	
 
    - name: Install console-based XMPP client (for interactive testing)
 
      apt:
 
        name: mcabber
 
        state: present
 

	
 
    - name: Install console-based XMPP tool (for non-interactive testing)
 
      apt:
 
        name: sendxmpp
 
        state: present
 

	
 
    - name: Create dedicated group for testing
 
      group:
 
        name: user
 
        state: present
 

	
 
    - name: Create dedicated user for testing
 
      user:
 
        name: user
 
        group: user
 
        shell: /bin/bash
 

	
 
    - name: Deploy mcabber configuration files
 
      template:
 
        src: tests/data/mcabber.cfg.j2
 
        dest: "~user/{{ item.jid }}.cfg"
 
        owner: user
 
        group: user
 
        mode: 0600
 
      with_items:
 
        - jid: john.doe@domain1
 
          password: johnpassword
 
          server: domain1
 
          security: tls
 
          nickname: john.doe
 
        - jid: jane.doe@domain2
 
          password: janepassword
 
          server: domain2
 
          security: ssl
 
          nickname: jane.doe
 
        - jid: mick.doe@domain3
 
          password: mickpassword
 
          server: domain3
 
          security: tls
 
          nickname: mick.doe
 
        - jid: noxmpp@domain1
 
          password: noxmpppassword
 
          server: domain1
 
          security: tls
 
          nickname: noxmpp
 
        - jid: eve.doe@domain4
 
          password: evepassword
 
          server: domain4
 
          security: tls
 
          nickname: eve.doe
 

	
 
  handlers:
 

	
 
    - name: Update CA certificate cache
 
      command: /usr/sbin/update-ca-certificates --fresh
 

	
 
- hosts: ldap-server
 
  become: true
 
  roles:
 
    - ldap_server
 
    - backup_server
 

	
 
- hosts: ldap-server
 
  become: true
 
  tasks:
 

	
 
    - name: Create LDAP accounts for testing
 
      ldap_entry:
 
        dn: "{{ item.dn }}"
 
        objectClass: "{{ item.objectClass }}"
 
        attributes: "{{ item.attributes }}"
 
      with_items:
 
        - dn: uid=john,ou=people,dc=local
 
          objectClass:
 
            - inetOrgPerson
 
            - simpleSecurityObject
 
          attributes:
 
            userPassword: johnpassword
 
            uid: john
 
            cn: John Doe
 
            sn: Doe
 
            mail: john.doe@domain1
 

	
 
        - dn: uid=jane,ou=people,dc=local
 
          objectClass:
 
            - inetOrgPerson
 
            - simpleSecurityObject
 
          attributes:
 
            userPassword: janepassword
 
            uid: jane
 
            cn: Jane Doe
 
            sn: Doe
 
            mail: jane.doe@domain2
 

	
 
        - dn: uid=mick,ou=people,dc=local
 
          objectClass:
 
            - inetOrgPerson
 
            - simpleSecurityObject
 
          attributes:
 
            userPassword: mickpassword
 
            uid: mick
 
            cn: Mick Doe
 
            sn: Doe
 
            mail: mick.doe@domain3
 

	
 
        - dn: uid=noxmpp,ou=people,dc=local
 
          objectClass:
 
            - inetOrgPerson
 
            - simpleSecurityObject
 
          attributes:
 
            userPassword: noxmpppassword
 
            uid: noxmpp
 
            cn: No XMPP
 
            sn: XMPP
 
            mail: noxmpp@domain1
 

	
 
        - dn: uid=eve,ou=people,dc=local
 
          objectClass:
 
            - inetOrgPerson
 
            - simpleSecurityObject
 
          attributes:
 
            userPassword: evepassword
 
            uid: eve
 
            cn: Eve Doe
 
            sn: Doe
 
            mail: eve.doe@domain4
 

	
 
    - name: Add test accounts to correct group
 
      ldap_attr:
 
        dn: "cn=xmpp,ou=groups,dc=local"
 
        name: uniqueMember
 
        state: exact
 
        values:
 
          - uid=john,ou=people,dc=local
 
          - uid=jane,ou=people,dc=local
 
          - uid=mick,ou=people,dc=local
 
          - uid=eve,ou=people,dc=local
 

	
 
- hosts: parameters-mandatory,parameters-optional,deprecated
 
  become: true
 
  tasks:
 

	
 
    - name: Install console-based XMPP tool (for non-interactive testing)
 
      apt:
 
        name: sendxmpp
 
        state: present
 

	
 
    - name: Deploy small Lua script for listing the enabled modules in Prosody
 
      copy:
 
        src: list_prosody_modules.lua
 
        dest: "/usr/local/bin/list_prosody_modules.lua"
 
        owner: root
 
        group: root
 
        mode: 0755
roles/xmpp_server/tasks/main.yml
Show inline comments
 
---
 

	
 
# 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
 
  notify:
 
    - Restart Prosody
 

	
 
- name: Collect information about installed packages
 
  package_facts:
 

	
 
- name: Uninstall Prosody from project-provided repository
 
  apt:
 
    name: prosody
 
    state: absent
 
  when:
 
    - "ansible_facts.packages['prosody'] is defined"
 
    - "'nightly' in ansible_facts.packages['prosody'][0].version"
 

	
 
- name: Uninstall Prosody dependencies from project-provided repository
 
  apt:
 
    name:
 
      - lua-expat
 
      - lua-filesystem
 
      - lua-sec
 
      - lua-socket
 
    state: absent
 
  when: >-
 
    (ansible_facts.packages['lua-expat'] is defined and 'prosody' in ansible_facts.packages['lua-expat'][0].version)
 
    or (ansible_facts.packages['lua-filesystem'] is defined and 'prosody' in ansible_facts.packages['lua-filesystem'][0].version)
 
    or (ansible_facts.packages['lua-sec'] is defined and 'prosody' in ansible_facts.packages['lua-sec'][0].version)
 
    or (ansible_facts.packages['lua-socket'] is defined and 'prosody' in ansible_facts.packages['lua-socket'][0].version)
 

	
 
- name: Remove Prosody project-provided apt key
 
  apt_key:
 
    id: "{{ item }}"
 
    state: absent
 
  with_items:
 
    - "107D65A0A148C237FDF00AB47393D7E674D9DBB5"
 
    - "44AB6DD06DA46979CFAF997F9B1B82786C8F28BA"
 

	
 
- name: Remove Prosody project-provided repository
 
  apt_repository:
 
    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:
 
      - lua-ldap
 
      - prosody-modules
 
    state: present
 
  notify:
 
    - Restart Prosody
 

	
 
- name: Install Prosody
 
  apt:
 
    name: prosody
 
    state: present
 
  notify:
 
    - Restart Prosody
 

	
 
- name: Allow Prosody user to traverse the directory with TLS private keys
 
  user:
 
    name: prosody
 
    append: true
 
    groups: ssl-cert
 

	
 
- name: Deploy XMPP TLS private key
 
  copy:
 
    dest: "/etc/ssl/private/{{ ansible_fqdn }}_xmpp.key"
 
    content: "{{ xmpp_tls_key }}"
 
    owner: root
 
    group: prosody
 
    mode: 0640
 
  notify:
 
    - Restart Prosody
 

	
 
- name: Deploy XMPP TLS certificate
 
  copy:
 
    dest: "/etc/ssl/certs/{{ ansible_fqdn }}_xmpp.pem"
 
    content: "{{ xmpp_tls_certificate }}"
 
    owner: root
 
    group: root
 
    mode: 0644
 
  notify:
 
    - Restart Prosody
 

	
 
- name: Generate the XMPP server Diffie-Hellman parameter
 
  openssl_dhparam:
 
    owner: root
 
    group: prosody
 
    mode: 0640
 
    path: "/etc/ssl/private/{{ ansible_fqdn }}_xmpp.dh.pem"
 
    size: 2048
 
  notify:
 
    - Restart Prosody
 

	
 
- name: Deploy configuration file for checking certificate validity via cron
 
  copy:
 
    content: "/etc/ssl/certs/{{ ansible_fqdn }}_xmpp.pem"
 
    dest: "/etc/check_certificate/{{ ansible_fqdn }}_xmpp.conf"
 
    owner: root
 
    group: root
 
    mode: 0644
 

	
 
- name: Deploy script for validating Prosody certificate
 
  copy:
 
    src: "check_prosody_certificate.sh"
 
    dest: "/usr/local/bin/check_prosody_certificate.sh"
 
    owner: root
 
    group: root
 
    mode: 0755
 

	
 
- name: Set-up crontab task that runs the Prosody certificate checker script once a day
 
  copy:
 
    src: "cron_check_prosody_certificate"
 
    dest: "/etc/cron.d/check_prosody_certificate"
 
    owner: root
 
    group: root
 
    mode: 0644
 

	
 
- name: Deploy Prosody configuration file
 
  template:
 
    src: "prosody.cfg.lua.j2"
 
    dest: "/etc/prosody/prosody.cfg.lua"
 
    owner: root
 
    group: prosody
 
    mode: 0640
 
  notify:
 
    - Restart Prosody
 

	
 
- name: Enable and start Prosody service
 
  service:
 
    name: prosody
 
    state: started
 
    enabled: true
 

	
 
- name: Deploy firewall configuration for XMPP server
 
  copy:
 
    src: "ferm_xmpp.conf"
 
    dest: "/etc/ferm/conf.d/30-xmpp.conf"
 
    owner: root
 
    group: root
 
    mode: 0640
 
  notify:
 
    - Restart ferm
 

	
 
- name: Explicitly run all handlers
 
  include: ../handlers/main.yml
 
  when: "run_handlers | default(False) | bool()"
 
  tags:
 
    - handlers
0 comments (0 inline, 0 general)