From eb6d9c7d665110bd429d4c001585cfcc6ca08383 2020-11-10 22:20:27 From: Branko Majic Date: 2020-11-10 22:20:27 Subject: [PATCH] MAR-171: Make the xmpp_domains parameter mandatory: - Updated release notes. - Updated role reference documentation. - Dropped the default value for parameter from the xmpp_server role. - Updated tests. --- diff --git a/docs/releasenotes.rst b/docs/releasenotes.rst index 18e869b7a35cb90008d9e330525ef55f2a7065a9..30c2bd11c9bb21001e0e974e70fbc0a9053cf756 100644 --- a/docs/releasenotes.rst +++ b/docs/releasenotes.rst @@ -90,6 +90,8 @@ Breaking changes: * ``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. diff --git a/docs/rolereference.rst b/docs/rolereference.rst index 0676d0f631faed9a5c2ffd98860e95dad643df81..2048589d2dfae556de58c8737bcd3c01a930eb99 100644 --- a/docs/rolereference.rst +++ b/docs/rolereference.rst @@ -904,7 +904,7 @@ Parameters Prosody. Each item is a string with value equal to XMPP user ID (i.e. ``john.doe@example.com``). -**xmpp_domains** (list, optional, ``{{ ansible_domain }}``) +**xmpp_domains** (list, mandatory) List of domains that are served by this Prosody instance. Each item is a string specifying a domain. diff --git a/roles/xmpp_server/defaults/main.yml b/roles/xmpp_server/defaults/main.yml index 74eee3909cbb4cf55f31ddf44204da19217f8af1..022709b83be8571481cffb1c5c309d5bf6bafb62 100644 --- a/roles/xmpp_server/defaults/main.yml +++ b/roles/xmpp_server/defaults/main.yml @@ -1,8 +1,6 @@ --- enable_backup: false -xmpp_domains: - - "{{ ansible_domain }}" xmpp_prosody_package: "prosody-0.10" xmpp_server_tls_protocol: "tlsv1_2+" xmpp_server_tls_ciphers: "\ diff --git a/roles/xmpp_server/molecule/default/group_vars/parameters-mandatory.yml b/roles/xmpp_server/molecule/default/group_vars/parameters-mandatory.yml index 176d3f666b622b5a10e096cc455fae580cef697c..c03d177095582f45695e4f60889ae0372d79e3de 100644 --- a/roles/xmpp_server/molecule/default/group_vars/parameters-mandatory.yml +++ b/roles/xmpp_server/molecule/default/group_vars/parameters-mandatory.yml @@ -2,6 +2,8 @@ xmpp_administrators: - john.doe@domain1 +xmpp_domains: + - domain1 xmpp_ldap_base_dn: dc=local xmpp_ldap_password: prosodypassword xmpp_ldap_server: ldap-server diff --git a/roles/xmpp_server/molecule/default/molecule.yml b/roles/xmpp_server/molecule/default/molecule.yml index 7478ecf5830b700cb6e22804a34d928e0357af67..77a5daa690a5d53ea7dfe8659f9ab93b4370ecd6 100644 --- a/roles/xmpp_server/molecule/default/molecule.yml +++ b/roles/xmpp_server/molecule/default/molecule.yml @@ -37,7 +37,7 @@ platforms: network_name: private_network type: static - - name: parameters-mandatory-stretch64.domain1 + - name: parameters-mandatory-stretch64 groups: - parameters-mandatory - stretch diff --git a/roles/xmpp_server/molecule/default/prepare.yml b/roles/xmpp_server/molecule/default/prepare.yml index 60bbe5471f0b58435c08e3c74f7a09236fc914f2..a3ba13b58393df2d5305e500bec1f0520c8f5952 100644 --- a/roles/xmpp_server/molecule/default/prepare.yml +++ b/roles/xmpp_server/molecule/default/prepare.yml @@ -22,7 +22,7 @@ - name: ldap-server_ldap fqdn: - ldap-server - - name: parameters-mandatory-stretch64.domain1_xmpp + - name: parameters-mandatory-stretch64_xmpp fqdn: - parameters-mandatory - domain1 diff --git a/roles/xmpp_server/molecule/default/tests/test_mandatory.py b/roles/xmpp_server/molecule/default/tests/test_mandatory.py index 13e45be35959a49f7fe46c30cc613a96401e2664..f8137e8e00fa3d91b7aae42f355fedac38cacf3b 100644 --- a/roles/xmpp_server/molecule/default/tests/test_mandatory.py +++ b/roles/xmpp_server/molecule/default/tests/test_mandatory.py @@ -19,12 +19,12 @@ def test_certificate_validity_check_configuration(host): hostname = host.run('hostname').stdout.strip() - config = host.file('/etc/check_certificate/%s.domain1_xmpp.conf' % hostname) + config = host.file('/etc/check_certificate/%s_xmpp.conf' % hostname) assert config.is_file assert config.user == 'root' assert config.group == 'root' assert config.mode == 0o644 - assert config.content_string == "/etc/ssl/certs/%s.domain1_xmpp.pem" % hostname + assert config.content_string == "/etc/ssl/certs/%s_xmpp.pem" % hostname def test_prosody_configuration_file_content(host): @@ -39,8 +39,8 @@ def test_prosody_configuration_file_content(host): config = host.file('/etc/prosody/prosody.cfg.lua') assert "admins = { \"john.doe@domain1\", }" in config.content_string - assert "key = \"/etc/ssl/private/%s.domain1_xmpp.key\";" % hostname in config.content_string - assert "certificate = \"/etc/ssl/certs/%s.domain1_xmpp.pem\";" % hostname in config.content_string + assert "key = \"/etc/ssl/private/%s_xmpp.key\";" % hostname in config.content_string + assert "certificate = \"/etc/ssl/certs/%s_xmpp.pem\";" % hostname in config.content_string assert "ldap_server = \"ldap-server\"" in config.content_string assert "ldap_rootdn = \"cn=prosody,ou=services,dc=local\"" in config.content_string assert "ldap_password = \"prosodypassword\"" in config.content_string