From 3425f774d3d17233cca4aa9f16b6ef0f2b405d4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Vi=C3=B1ar=20Ulriksen?= Date: Wed, 13 Nov 2024 21:02:28 -0300 Subject: [PATCH 01/33] WIP: running the role --- tasks/main.yml | 15 ++++++++++++--- templates/topics.conf.j2 | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index d029780..0fe52fb 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -124,7 +124,7 @@ owner: "{{ sympa_unix_user }}" group: "{{ sympa_unix_group }}" mode: 0640 - no_log: true + # no_log: true when: sympa_installation_method != 'package' or ansible_os_family == 'RedHat' notify: - restart sympa @@ -134,8 +134,11 @@ - sympa - sympa-conf +- debug: + msg: '{{ sympa_robots | default([]) | count > 0 }}' + - name: Create configuration files for robots on request - import_tasks: robots.yml + include_tasks: robots.yml when: sympa_robots | default([]) | count > 0 tags: - sympa @@ -175,6 +178,12 @@ - sympa-conf - sympa-edit-list +- debug: + var: sympa_topics + +- debug: + msg: '{{ sympa_topics | count > 0 }}' + - name: Create configuration file topics.conf template: src: topics.conf.j2 @@ -184,7 +193,7 @@ mode: 0640 when: - sympa_topics is defined - - sympa_topics | count + - sympa_topics | count > 0 notify: - restart sympa - restart wwsympa diff --git a/templates/topics.conf.j2 b/templates/topics.conf.j2 index 6aca137..8ceef78 100644 --- a/templates/topics.conf.j2 +++ b/templates/topics.conf.j2 @@ -1,4 +1,4 @@ -{% for topic in sympa_topics %} +{% for topic in sympa_topics | default([]) %} {{ topic.name }} title {{ topic.title | default(topic.name ) }} From 08265c2a9d35a3631ba7ba2609d22d90b92ad3d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Vi=C3=B1ar=20Ulriksen?= Date: Mon, 18 Nov 2024 19:07:56 -0300 Subject: [PATCH 02/33] Additionnal aliases_db_type in sympa.conf --- templates/sympa.conf.j2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/templates/sympa.conf.j2 b/templates/sympa.conf.j2 index bd6fac0..ecdd1d9 100644 --- a/templates/sympa.conf.j2 +++ b/templates/sympa.conf.j2 @@ -115,6 +115,10 @@ alias_manager {{ sympa_config_alias_manager }} aliases_program {{ sympa_config_aliases_program }} {% endif %} +{% if sympa_config_aliases_db_type is defined %} +aliases_db_type {{ sympa_config_aliases_db_type }} +{% endif %} + {% if sympa_config_aliases_wrapper is defined %} aliases_wrapper {{ sympa_config_aliases_wrapper }} {% endif %} From f76d0de2ec827fb025471349e47cffe03d0dfb2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Vi=C3=B1ar=20Ulriksen?= Date: Tue, 26 Nov 2024 09:10:10 -0300 Subject: [PATCH 03/33] superflous changes --- tasks/main.yml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 0fe52fb..d029780 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -124,7 +124,7 @@ owner: "{{ sympa_unix_user }}" group: "{{ sympa_unix_group }}" mode: 0640 - # no_log: true + no_log: true when: sympa_installation_method != 'package' or ansible_os_family == 'RedHat' notify: - restart sympa @@ -134,11 +134,8 @@ - sympa - sympa-conf -- debug: - msg: '{{ sympa_robots | default([]) | count > 0 }}' - - name: Create configuration files for robots on request - include_tasks: robots.yml + import_tasks: robots.yml when: sympa_robots | default([]) | count > 0 tags: - sympa @@ -178,12 +175,6 @@ - sympa-conf - sympa-edit-list -- debug: - var: sympa_topics - -- debug: - msg: '{{ sympa_topics | count > 0 }}' - - name: Create configuration file topics.conf template: src: topics.conf.j2 @@ -193,7 +184,7 @@ mode: 0640 when: - sympa_topics is defined - - sympa_topics | count > 0 + - sympa_topics | count notify: - restart sympa - restart wwsympa From 153012ade1edc8f693111214ad37a2917ed508a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Vi=C3=B1ar=20Ulriksen?= Date: Fri, 21 Mar 2025 09:17:53 -0300 Subject: [PATCH 04/33] adding LDAP perl module --- tasks/perl-modules.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tasks/perl-modules.yml b/tasks/perl-modules.yml index 5c37b95..195f58c 100644 --- a/tasks/perl-modules.yml +++ b/tasks/perl-modules.yml @@ -58,6 +58,12 @@ when: sympa_soap_fcgi_enabled tags: sympasoap +- name: Add Net::LDAP to features if LDAP auth is enabled + set_fact: + sympa_cpanm_features: "{{ sympa_cpanm_features + ['Net::LDAP'] }}" + when: sympa_ldap_auth_enabled + tags: sympaldap + - name: Install Perl modules with cpanm command: "{{ sympa_cpanm_program }} --notest --installdeps {{ sympa_source_directory }}{% for feature in sympa_cpanm_features %} --with-feature {{ feature }}{% endfor %}" tags: sympasoap From 3c535f769c9c3a700ea0b365b3710e8d3b61b4a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Vi=C3=B1ar=20Ulriksen?= Date: Fri, 2 May 2025 09:19:21 -0300 Subject: [PATCH 05/33] adding IO::Socket::SSL module, also for LDAP auth --- tasks/perl-modules.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/perl-modules.yml b/tasks/perl-modules.yml index 195f58c..2f067e4 100644 --- a/tasks/perl-modules.yml +++ b/tasks/perl-modules.yml @@ -60,7 +60,7 @@ - name: Add Net::LDAP to features if LDAP auth is enabled set_fact: - sympa_cpanm_features: "{{ sympa_cpanm_features + ['Net::LDAP'] }}" + sympa_cpanm_features: "{{ sympa_cpanm_features + ['Net::LDAP'. 'IO::Socket::SSL'] }}" when: sympa_ldap_auth_enabled tags: sympaldap From 58e92a6df1e8389415c5f9143207ead670a11f1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Vi=C3=B1ar=20Ulriksen?= Date: Sun, 4 May 2025 19:27:33 -0300 Subject: [PATCH 06/33] fixing list of modules, robots.conf configuration --- tasks/perl-modules.yml | 2 +- templates/robot.conf.j2 | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/tasks/perl-modules.yml b/tasks/perl-modules.yml index 2f067e4..cdd8b41 100644 --- a/tasks/perl-modules.yml +++ b/tasks/perl-modules.yml @@ -60,7 +60,7 @@ - name: Add Net::LDAP to features if LDAP auth is enabled set_fact: - sympa_cpanm_features: "{{ sympa_cpanm_features + ['Net::LDAP'. 'IO::Socket::SSL'] }}" + sympa_cpanm_features: "{{ sympa_cpanm_features + ['Net::LDAP', 'IO::Socket::SSL'] }}" when: sympa_ldap_auth_enabled tags: sympaldap diff --git a/templates/robot.conf.j2 b/templates/robot.conf.j2 index 6df1004..3b5d6e6 100644 --- a/templates/robot.conf.j2 +++ b/templates/robot.conf.j2 @@ -1,8 +1,31 @@ # Robot configuration for {{ item.domain }} domain {{ item.domain }} +# Robot's listmaster + +{% if item.listmaster is defined %} +listmaster {% if item.listmaster is string %}{{ item.listmaster }}{% else %}{{ item.listmaster | join(',') }}{% endif %} +{% else %} +listmaster listmaster@{{ item.domain }} +{% endif %} + {% if sympa_web_fcgi_enabled %} # Web interface wwsympa_url {{ sympa_web_fcgi_protocol }}://{{ item.web_domain | default(item.domain) }}/{{ sympa_web_path }} cookie_domain {{ item.web_domain | default(item.domain) }} {% endif %} +{% if item.config_title is defined %} +title {{ item.config_title }} +{% endif %} +{% if item.config_favicon_url is defined %} +favicon_url {{ item.config_favicon_url }} +{% endif %} +{% if item.config_logo_html_definition is defined %} +logo_html_definition {{ item.config_logo_html_definition | replace('\n', ' ') }} +{% endif %} +{% if item.config_colors is defined %} +## Colors +{% for color in item.config_colors %} +color_{{ loop.index - 1 }} {{ color }} +{% endfor %} + From 9df15d04ec0b33389f6025ae03137280128f3113 Mon Sep 17 00:00:00 2001 From: Francisco Date: Wed, 30 Jul 2025 17:19:48 -0300 Subject: [PATCH 07/33] fix if clause, perl modules --- tasks/perl-modules.yml | 17 ++++++++++++----- templates/robot.conf.j2 | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/tasks/perl-modules.yml b/tasks/perl-modules.yml index cdd8b41..a4fafe1 100644 --- a/tasks/perl-modules.yml +++ b/tasks/perl-modules.yml @@ -55,15 +55,22 @@ - name: Add SOAP to features if SOAP interface is enabled set_fact: sympa_cpanm_features: "{{ sympa_cpanm_features + ['soap'] }}" - when: sympa_soap_fcgi_enabled + when: sympa_soap_fcgi_enabled | bool tags: sympasoap -- name: Add Net::LDAP to features if LDAP auth is enabled +- name: Add ldap-secure to features if LDAP auth is enabled set_fact: - sympa_cpanm_features: "{{ sympa_cpanm_features + ['Net::LDAP', 'IO::Socket::SSL'] }}" - when: sympa_ldap_auth_enabled + sympa_cpanm_features: "{{ sympa_cpanm_features + ['ldap-secure'] }}" + when: sympa_ldap_auth_enabled | bool tags: sympaldap +- name: Print features before install + ansible.builtin.debug: + var: sympa_cpanm_features + verbosity: 1 + - name: Install Perl modules with cpanm command: "{{ sympa_cpanm_program }} --notest --installdeps {{ sympa_source_directory }}{% for feature in sympa_cpanm_features %} --with-feature {{ feature }}{% endfor %}" - tags: sympasoap + tags: + - sympasoap + - sympaldap diff --git a/templates/robot.conf.j2 b/templates/robot.conf.j2 index 3b5d6e6..e84c700 100644 --- a/templates/robot.conf.j2 +++ b/templates/robot.conf.j2 @@ -28,4 +28,4 @@ logo_html_definition {{ item.config_logo_html_definition | replace('\n', ' ') }} {% for color in item.config_colors %} color_{{ loop.index - 1 }} {{ color }} {% endfor %} - +{% endif %} From 0e479902ca699af7465f8c32b72af7a1edd38684 Mon Sep 17 00:00:00 2001 From: Paulo Ruiz Date: Thu, 31 Jul 2025 12:17:19 -0300 Subject: [PATCH 08/33] add task to install LDAP libraries needed --- tasks/perl-modules.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tasks/perl-modules.yml b/tasks/perl-modules.yml index a4fafe1..8754c68 100644 --- a/tasks/perl-modules.yml +++ b/tasks/perl-modules.yml @@ -42,6 +42,14 @@ name: "{{ sympa_openssldev_package }}" when: sympa_config_dkim_feature or sympa_soap_fcgi_enabled +- name: Install SSL development library and zlib development needed for LDAP + package: + name: + - "{{ sympa_openssldev_package }}" + - "{{ sympa_zlibdev_package }}" + when: sympa_ldap_auth_enabled | bool + tags: sympaldap + - name: Add Mail::DKIM::Verifier to features if DKIM support is requested set_fact: sympa_cpanm_features: "{{ sympa_cpanm_features + ['Mail::DKIM::Verifier'] }}" From 123afa6d0560df47ea746bc6c4098fdfec01c97e Mon Sep 17 00:00:00 2001 From: Paulo Ruiz Date: Thu, 7 Aug 2025 19:55:52 -0300 Subject: [PATCH 09/33] Update sympa.conf template to use DKIM --- defaults/main.yml | 11 +++++++++++ templates/sympa.conf.j2 | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index eb59288..c7d5175 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -162,3 +162,14 @@ sympa_soap_nginx_snippet: | sympa_install_odbc_driver: false sympa_rsyslog_unix_user: "{{ sympa_unix_user }}" + +sympa_dkim_feature: false +sympa_dkim_add_signature_to: + - robot + - list +sympa_dkim_private_key_path: /etc/ssl/dkim_private.key +sympa_dkim_signature_apply_on: + - md5_authenticated_messages + - smime_authenticated_messages + - dkim_authenticated_messages + - editor_validated_messages diff --git a/templates/sympa.conf.j2 b/templates/sympa.conf.j2 index 6964020..032ec93 100644 --- a/templates/sympa.conf.j2 +++ b/templates/sympa.conf.j2 @@ -143,3 +143,35 @@ process_archive {{ sympa_config_process_archive | bool | ternary('on', 'off') }} # Extra parameters {{ sympa_config_extra_parameters }} {% endif %} + +###\\\\ DKIM ////### + +## dkim_feature +dkim_feature {% if sympa_dkim_feature %}on{% else %}off{% endif %} + +## dkim_signature_apply_on +## Type of message that is added a DKIM signature before distribution to +## subscribers. Possible values are "none", "any" or a list of the following +## keywords: "md5_authenticated_messages", "smime_authenticated_messages", +## "dkim_authenticated_messages", "editor_validated_messages". +{% if sympa_dkim_signature_apply_on | length>0 %} +dkim_signature_apply_on {{ sympa_dkim_signature_apply_on | join(',') }} +{% else %} +dkim_signature_apply_on none +{% endif %} + +## dkim_private_key_path +## Location of the file where DKIM private key is stored +dkim_parameters.private_key_path {{ sympa_dkim_private_key_path }} + +## dkim_signer_domain +## The "d=" tag as defined in rfc 4871, default is virtual host domain name +{% if sympa_dkim_signer_domain is defined %} +dkim_parameters.signer_domain {{ sympa_dkim_signer_domain }} +{% endif %} + +## dkim_selector +## The selector +{% if sympa_dkim_selector is defined %} +dkim_parameters.selector {{ sympa_dkim_selector }} +{% endif %} From 55d051b046afe0fc66defd9c1ee548289f3ed7df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Vi=C3=B1ar=20Ulriksen?= Date: Fri, 8 Aug 2025 20:43:27 -0300 Subject: [PATCH 10/33] WIP: configuring robots --- tasks/main.yml | 15 +++++++++++++-- tasks/{robots.yml => robot.yml} | 22 +++++++--------------- templates/robot.conf.j2 | 23 +++++++++++++++++++---- 3 files changed, 39 insertions(+), 21 deletions(-) rename tasks/{robots.yml => robot.yml} (51%) diff --git a/tasks/main.yml b/tasks/main.yml index d7be4c2..47cac00 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -135,8 +135,19 @@ - sympa-conf - name: Create configuration files for robots on request - import_tasks: robots.yml - when: sympa_robots | default([]) | count > 0 + include_tasks: + file: robot.yml + apply: + tags: + - sympa + - sympa-conf + - sympa-robots + loop: "{{ sympa_robots | default([]) }}" + loop_control: + loop_var: sympa_robot + when: + - sympa_robots | default([]) | count > 0 + - sympa_robot.domain != sympa_domain tags: - sympa - sympa-conf diff --git a/tasks/robots.yml b/tasks/robot.yml similarity index 51% rename from tasks/robots.yml rename to tasks/robot.yml index 7e08c31..a412114 100644 --- a/tasks/robots.yml +++ b/tasks/robot.yml @@ -2,45 +2,37 @@ # Copyright (C) 2020-2022 Stefan Hornburg (Racke) # SPDX-License-Identifier: GPL-2.0-or-later -- name: Create directory for robots +- name: Create directory for {{ sympa_robot.domain }} robot file: state: directory - path: "{{ sympa_configuration_directory }}/{{ item.domain }}" + path: "{{ sympa_configuration_directory }}/{{ sympa_robot.domain }}" owner: "{{ sympa_unix_user }}" group: "{{ sympa_unix_group }}" mode: 0755 - when: item.domain != sympa_domain - loop: "{{ sympa_robots }}" - name: Create list data directory for robots file: state: directory - path: "{{ sympa_list_home_directory }}/{{ item.domain }}" + path: "{{ sympa_list_home_directory }}/{{ sympa_robot.domain }}" owner: "{{ sympa_unix_user }}" group: "{{ sympa_unix_group }}" mode: 0755 - when: item.domain != sympa_domain - loop: "{{ sympa_robots }}" -- name: Create list data directory for robots +- name: Create archives' directory {{ sympa_robot.domain }} robot file: state: directory - path: "{{ sympa_list_home_directory }}/{{ item.domain }}" + path: "{{ sympa_installation_directory }}/arc/{{ sympa_robot.domain }}" owner: "{{ sympa_unix_user }}" group: "{{ sympa_unix_group }}" mode: 0755 - when: item.domain != sympa_domain - loop: "{{ sympa_robots }}" -- name: Create configuration file +- name: Create {{ sympa_robot.domain }} robot configuration file template: src: robot.conf.j2 - dest: "{{ sympa_configuration_directory }}/{{ item.domain }}/robot.conf" + dest: "{{ sympa_configuration_directory }}/{{ sympa_robot.domain }}/robot.conf" owner: "{{ sympa_unix_user }}" group: "{{ sympa_unix_group }}" mode: 0644 - when: item.domain != sympa_domain - loop: "{{ sympa_robots }}" notify: - restart sympa - restart wwsympa diff --git a/templates/robot.conf.j2 b/templates/robot.conf.j2 index 6df1004..efcc5a1 100644 --- a/templates/robot.conf.j2 +++ b/templates/robot.conf.j2 @@ -1,8 +1,23 @@ -# Robot configuration for {{ item.domain }} -domain {{ item.domain }} +# Robot configuration for {{ sympa_robot.domain }} +domain {{ sympa_robot.domain }} + +# Robot's listmaster +{% if sympa_robot.listmaster is defined %} +listmaster {% if sympa_robot.listmaster is string %}{{ sympa_robot.listmaster }}{% else %}{{ sympa_robot.listmaster | join(',') }}{% endif %} +{% else %} +listmaster listmaster@{{ sympa_robot.domain }} +{% endif %} {% if sympa_web_fcgi_enabled %} # Web interface -wwsympa_url {{ sympa_web_fcgi_protocol }}://{{ item.web_domain | default(item.domain) }}/{{ sympa_web_path }} -cookie_domain {{ item.web_domain | default(item.domain) }} +wwsympa_url {{ sympa_web_fcgi_protocol }}://{{ sympa_robot.web_domain | default(sympa_robot.domain) }}/{{ sympa_web_path }} +cookie_domain {{ sympa_robot.web_domain | default(sympa_robot.domain) }} {% endif %} + +{% for robot_parameter in sympa_web_authentication %} +{% for key,var in sympa_robot.items() %} +{% if key != 'domain' and key != 'listmaster' %} +{{ key }} {{ var }} +{% endif %} +{% endfor %} +{% endfor %} From 735140faf0d56dc303f463b5bcb5211a62ba40a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Vi=C3=B1ar=20Ulriksen?= Date: Fri, 8 Aug 2025 22:54:36 -0300 Subject: [PATCH 11/33] considering compounding parameters --- tasks/robot.yml | 2 +- templates/robot.conf.j2 | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tasks/robot.yml b/tasks/robot.yml index a412114..a422c7a 100644 --- a/tasks/robot.yml +++ b/tasks/robot.yml @@ -10,7 +10,7 @@ group: "{{ sympa_unix_group }}" mode: 0755 -- name: Create list data directory for robots +- name: Create list data directory for {{ sympa_robot.domain }} robot file: state: directory path: "{{ sympa_list_home_directory }}/{{ sympa_robot.domain }}" diff --git a/templates/robot.conf.j2 b/templates/robot.conf.j2 index efcc5a1..e0c80cd 100644 --- a/templates/robot.conf.j2 +++ b/templates/robot.conf.j2 @@ -14,10 +14,12 @@ wwsympa_url {{ sympa_web_fcgi_protocol }}://{{ sympa_robot.web_domain | default( cookie_domain {{ sympa_robot.web_domain | default(sympa_robot.domain) }} {% endif %} -{% for robot_parameter in sympa_web_authentication %} -{% for key,var in sympa_robot.items() %} -{% if key != 'domain' and key != 'listmaster' %} -{{ key }} {{ var }} -{% endif %} +{% for robot_param,value in sympa_robot.items() %} +{% if robot_param != 'domain' and robot_param != 'listmaster' %} +{% if value is mapping %}{{ robot_param }}{% for sub_el,val in sympa_robot.items() %} +{{ robot_param }}.{{ sub_el }} {{ val }} {% endfor %} +{% else %} +{{ robot_param }} {{ value }} +{% endif %} {% endif %} {% endfor %} From bc172c647c3503b371ddb5b1386a0dd281ee6fbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Vi=C3=B1ar=20Ulriksen?= Date: Sat, 9 Aug 2025 12:05:11 -0300 Subject: [PATCH 12/33] fixing: compounding parameters --- templates/robot.conf.j2 | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/templates/robot.conf.j2 b/templates/robot.conf.j2 index e0c80cd..170c921 100644 --- a/templates/robot.conf.j2 +++ b/templates/robot.conf.j2 @@ -9,17 +9,24 @@ listmaster listmaster@{{ sympa_robot.domain }} {% endif %} {% if sympa_web_fcgi_enabled %} + # Web interface wwsympa_url {{ sympa_web_fcgi_protocol }}://{{ sympa_robot.web_domain | default(sympa_robot.domain) }}/{{ sympa_web_path }} cookie_domain {{ sympa_robot.web_domain | default(sympa_robot.domain) }} {% endif %} {% for robot_param,value in sympa_robot.items() %} -{% if robot_param != 'domain' and robot_param != 'listmaster' %} -{% if value is mapping %}{{ robot_param }}{% for sub_el,val in sympa_robot.items() %} -{{ robot_param }}.{{ sub_el }} {{ val }} -{% endfor %} -{% else %} -{{ robot_param }} {{ value }} -{% endif %} {% endif %} -{% endfor %} + +{% if robot_param != 'domain' and robot_param != 'listmaster' %} + +{% if value is mapping %} +# {{ robot_param }} value(s) +{% for sub_el,val in value.items() -%} + {{ robot_param }}.{{ sub_el }} {{ val }} +{% endfor %} +{% else %} +# {{ robot_param }} value +{{ robot_param }} {{ value }} +{%- endif %} +{%- endif %} +{%- endfor %} From fee0a63c92fa2d83f178d805cc9339d0a8d48b3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Vi=C3=B1ar=20Ulriksen?= Date: Sat, 9 Aug 2025 12:30:31 -0300 Subject: [PATCH 13/33] default value for sympa_robots, documentation --- README.md | 26 ++++++++++++++++++++++++++ defaults/main.yml | 2 ++ tasks/main.yml | 4 ++-- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 466cc1a..b6e655b 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,32 @@ If no value is provided, `listmaster` will be joined with a @ to the For example: *listmaster@lists.example.com*. +### Sympa robots + +#### *sympa_robots* + +With *sympa_robots* the role defines and populates the `robots.conf` files of a multi-domains Sympa server. + +*sympa_robots* is a list of dicts, all dicts musn have a parameter *domain*, which defines the domain where the robot operates (mail and web). It may also contain any [configuration parameter valid in a `robot.conf` file](https://www.sympa.community/gpldoc/man/sympa_config.5.html), with its associated value(s). + +*listmaster* can be defined as an ansible list of emails, or as a string of comma separated email addresses. Compound paramentes can be defined as dicts. For instance: +``` +sympa_robots: + - domain: lists.mydomain.tld + listmaster: ... + + archive: + web_access: public + mail_access: private +``` +will render in the `robot.conf`: +``` +# archive value(s) +archive.web_access public +archive.mail_access private +``` + + ### Installation You can pick from different installation methods through the diff --git a/defaults/main.yml b/defaults/main.yml index eb59288..783c18b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -159,6 +159,8 @@ sympa_soap_nginx_snippet: | fastcgi_pass unix:/run/sympasoap/sympasoap.socket; } +sympa_robots: [] + sympa_install_odbc_driver: false sympa_rsyslog_unix_user: "{{ sympa_unix_user }}" diff --git a/tasks/main.yml b/tasks/main.yml index 47cac00..e120c63 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -142,11 +142,11 @@ - sympa - sympa-conf - sympa-robots - loop: "{{ sympa_robots | default([]) }}" + loop: "{{ sympa_robots }}" loop_control: loop_var: sympa_robot when: - - sympa_robots | default([]) | count > 0 + - sympa_robots | count > 0 - sympa_robot.domain != sympa_domain tags: - sympa From 67a06e6bd2b4db17aaaf43ff339172af703f0c61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Vi=C3=B1ar=20Ulriksen?= Date: Sun, 10 Aug 2025 21:57:27 -0300 Subject: [PATCH 14/33] sympa_robots as a dict --- README.md | 23 +++++++++++++++++++---- tasks/main.yml | 17 +++-------------- tasks/robot.yml | 25 +++++++++++++++++-------- tasks/robots.yml | 41 +++++++++++++++++++++++++++++++++++++++++ templates/robot.conf.j2 | 10 +++++----- 5 files changed, 85 insertions(+), 31 deletions(-) create mode 100644 tasks/robots.yml diff --git a/README.md b/README.md index b6e655b..3671c6a 100644 --- a/README.md +++ b/README.md @@ -126,25 +126,40 @@ For example: *listmaster@lists.example.com*. With *sympa_robots* the role defines and populates the `robots.conf` files of a multi-domains Sympa server. -*sympa_robots* is a list of dicts, all dicts musn have a parameter *domain*, which defines the domain where the robot operates (mail and web). It may also contain any [configuration parameter valid in a `robot.conf` file](https://www.sympa.community/gpldoc/man/sympa_config.5.html), with its associated value(s). +*sympa_robots* is a dict, where each key is the *domain* on which the robot operates (mail and web), and the value is a dict which defines the values of all the parameters of the robot. It may contain parameters such as listmaster, title, or any other [configuration parameter valid in a `robot.conf` file](https://www.sympa.community/gpldoc/man/sympa_config.5.html), with its associated value(s). -*listmaster* can be defined as an ansible list of emails, or as a string of comma separated email addresses. Compound paramentes can be defined as dicts. For instance: +*listmaster* can be defined as an ansible list of emails, or as a string of comma separated email addresses. Compound paramentes can be defined as sub-dicts. For instance: ``` sympa_robots: - - domain: lists.mydomain.tld + lists.mydomain.tld: listmaster: ... archive: web_access: public mail_access: private ``` -will render in the `robot.conf`: +will render in the `lists.mydomain.tld/robot.conf` configuration file: ``` +# Robot configuration for lists.mydomain.tld +domain lists.mydomain.tld + +# Robot's listmaster +listmaster ... + # archive value(s) archive.web_access public archive.mail_access private ``` +For backwards compatibility, *sympa_robots* can also be defined as a list of dicts where all items have a parameter *domain* defining the robot: +``` +sympa_robots: + - domain: lists.mydomain.tld + listmaster: ... + archive: + web_access: public + mail_access: private +``` ### Installation diff --git a/tasks/main.yml b/tasks/main.yml index e120c63..98ee07a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -134,20 +134,9 @@ - sympa - sympa-conf -- name: Create configuration files for robots on request - include_tasks: - file: robot.yml - apply: - tags: - - sympa - - sympa-conf - - sympa-robots - loop: "{{ sympa_robots }}" - loop_control: - loop_var: sympa_robot - when: - - sympa_robots | count > 0 - - sympa_robot.domain != sympa_domain +- name: Create configuration files for robots on request (dict variable) + import_tasks: + file: robots.yml tags: - sympa - sympa-conf diff --git a/tasks/robot.yml b/tasks/robot.yml index a422c7a..43e0b9d 100644 --- a/tasks/robot.yml +++ b/tasks/robot.yml @@ -2,34 +2,43 @@ # Copyright (C) 2020-2022 Stefan Hornburg (Racke) # SPDX-License-Identifier: GPL-2.0-or-later -- name: Create directory for {{ sympa_robot.domain }} robot +- name: Create directory for {{ sympa_robot_domain }} robot file: state: directory - path: "{{ sympa_configuration_directory }}/{{ sympa_robot.domain }}" + path: "{{ sympa_configuration_directory }}/{{ sympa_robot_domain }}" owner: "{{ sympa_unix_user }}" group: "{{ sympa_unix_group }}" mode: 0755 -- name: Create list data directory for {{ sympa_robot.domain }} robot +- name: Create list data directory for {{ sympa_robot_domain }} robot file: state: directory - path: "{{ sympa_list_home_directory }}/{{ sympa_robot.domain }}" + path: "{{ sympa_list_home_directory }}/{{ sympa_robot_domain }}" owner: "{{ sympa_unix_user }}" group: "{{ sympa_unix_group }}" mode: 0755 -- name: Create archives' directory {{ sympa_robot.domain }} robot +- name: Create archives' directory {{ sympa_robot_domain }} robot file: state: directory - path: "{{ sympa_installation_directory }}/arc/{{ sympa_robot.domain }}" + path: "{{ sympa_installation_directory }}/arc/{{ sympa_robot_domain }}" owner: "{{ sympa_unix_user }}" group: "{{ sympa_unix_group }}" mode: 0755 -- name: Create {{ sympa_robot.domain }} robot configuration file +- debug: + var: "{{ item }}" + verbosity: 2 + loop: + - sympa_robot_domain + - sympa_robot + - sympa_robots + + +- name: Create {{ sympa_robot_domain }} robot configuration file template: src: robot.conf.j2 - dest: "{{ sympa_configuration_directory }}/{{ sympa_robot.domain }}/robot.conf" + dest: "{{ sympa_configuration_directory }}/{{ sympa_robot_domain }}/robot.conf" owner: "{{ sympa_unix_user }}" group: "{{ sympa_unix_group }}" mode: 0644 diff --git a/tasks/robots.yml b/tasks/robots.yml new file mode 100644 index 0000000..046aadd --- /dev/null +++ b/tasks/robots.yml @@ -0,0 +1,41 @@ +--- +# Sympa robots configuration + +- name: Create configuration files for robots on request (dict variable) + include_tasks: + file: robot.yml + apply: + tags: + - sympa + - sympa-conf + - sympa-robots + loop: "{{ sympa_robots | list }}" + loop_control: + loop_var: sympa_robot_domain + vars: + sympa_robot_domain_query: '"{{ sympa_robot_domain }}"' + sympa_robot: "{{ sympa_robots | community.general.json_query ( sympa_robot_domain_query ) }}" + when: + - sympa_robots is mapping + - sympa_robot_domain != sympa_domain + + +- name: Create configuration files for robots on request (list variable) + include_tasks: + file: robot.yml + apply: + tags: + - sympa + - sympa-conf + - sympa-robots + loop: "{{ sympa_robots | list }}" + loop_control: + loop_var: sympa_robot + vars: + sympa_robot_domain: "{{ sympa_robot.domain }}" + when: + - sympa_robots is not mapping # then it must be a list of dicts + - sympa_robot_domain != sympa_domain + + +... diff --git a/templates/robot.conf.j2 b/templates/robot.conf.j2 index 170c921..2721619 100644 --- a/templates/robot.conf.j2 +++ b/templates/robot.conf.j2 @@ -1,18 +1,18 @@ -# Robot configuration for {{ sympa_robot.domain }} -domain {{ sympa_robot.domain }} +# Robot configuration for {{ sympa_robot_domain }} +domain {{ sympa_robot_domain }} # Robot's listmaster {% if sympa_robot.listmaster is defined %} listmaster {% if sympa_robot.listmaster is string %}{{ sympa_robot.listmaster }}{% else %}{{ sympa_robot.listmaster | join(',') }}{% endif %} {% else %} -listmaster listmaster@{{ sympa_robot.domain }} +listmaster listmaster@{{ sympa_robot_domain }} {% endif %} {% if sympa_web_fcgi_enabled %} # Web interface -wwsympa_url {{ sympa_web_fcgi_protocol }}://{{ sympa_robot.web_domain | default(sympa_robot.domain) }}/{{ sympa_web_path }} -cookie_domain {{ sympa_robot.web_domain | default(sympa_robot.domain) }} +wwsympa_url {{ sympa_web_fcgi_protocol }}://{{ sympa_robot.web_domain | default(sympa_robot_domain) }}/{{ sympa_web_path }} +cookie_domain {{ sympa_robot.web_domain | default(sympa_robot_domain) }} {% endif %} {% for robot_param,value in sympa_robot.items() %} From f61f71a3b84d61838914da7a02380e46067c70cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Vi=C3=B1ar=20Ulriksen?= Date: Mon, 11 Aug 2025 12:26:46 -0300 Subject: [PATCH 15/33] fixing robot.conf template merge --- templates/robot.conf.j2 | 8 -------- 1 file changed, 8 deletions(-) diff --git a/templates/robot.conf.j2 b/templates/robot.conf.j2 index 8ec6311..2721619 100644 --- a/templates/robot.conf.j2 +++ b/templates/robot.conf.j2 @@ -8,14 +8,6 @@ listmaster {% if sympa_robot.listmaster is string %}{{ sympa_robot.listmaster }} listmaster listmaster@{{ sympa_robot_domain }} {% endif %} -# Robot's listmaster - -{% if item.listmaster is defined %} -listmaster {% if item.listmaster is string %}{{ item.listmaster }}{% else %}{{ item.listmaster | join(',') }}{% endif %} -{% else %} -listmaster listmaster@{{ item.domain }} -{% endif %} - {% if sympa_web_fcgi_enabled %} # Web interface From b00cb5a34f4d1116aa9d70ba531fc5ea31516cdb Mon Sep 17 00:00:00 2001 From: Francisco Date: Mon, 11 Aug 2025 16:32:56 -0300 Subject: [PATCH 16/33] add no ssl ldap option --- defaults/main.yml | 3 +++ tasks/perl-modules.yml | 14 ++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 42d719f..15215b9 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -134,6 +134,9 @@ sympa_soap_fcgi_enabled: false sympa_soap_fcgi_protocol: https sympa_soap_fcgi_instances: 2 +sympa_ldap_auth_enabled: false +sympa_ldap_auth_ssl: true + sympa_web_nginx_snippet: | location = / { return 301 /{{ sympa_web_path }}; diff --git a/tasks/perl-modules.yml b/tasks/perl-modules.yml index 8754c68..f762dc7 100644 --- a/tasks/perl-modules.yml +++ b/tasks/perl-modules.yml @@ -47,7 +47,7 @@ name: - "{{ sympa_openssldev_package }}" - "{{ sympa_zlibdev_package }}" - when: sympa_ldap_auth_enabled | bool + when: sympa_ldap_auth_enabled and sympa_ldap_auth_ssl tags: sympaldap - name: Add Mail::DKIM::Verifier to features if DKIM support is requested @@ -63,13 +63,19 @@ - name: Add SOAP to features if SOAP interface is enabled set_fact: sympa_cpanm_features: "{{ sympa_cpanm_features + ['soap'] }}" - when: sympa_soap_fcgi_enabled | bool + when: sympa_soap_fcgi_enabled tags: sympasoap -- name: Add ldap-secure to features if LDAP auth is enabled +- name: Add ldap-secure to features if LDAP (ssl) auth is enabled set_fact: sympa_cpanm_features: "{{ sympa_cpanm_features + ['ldap-secure'] }}" - when: sympa_ldap_auth_enabled | bool + when: sympa_ldap_auth_enabled and sympa_ldap_auth_ssl + tags: sympaldap + +- name: Add ldap to features if LDAP (no SSL) auth is enabled + set_fact: + sympa_cpanm_features: "{{ sympa_cpanm_features + ['ldap'] }}" + when: sympa_ldap_auth_enabled and not sympa_ldap_auth_ssl tags: sympaldap - name: Print features before install From 549847704ce445deb75443b13838deccfbd3acd3 Mon Sep 17 00:00:00 2001 From: Francisco Date: Mon, 11 Aug 2025 16:46:47 -0300 Subject: [PATCH 17/33] add LDAP to README.md --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 3671c6a..7763fa7 100644 --- a/README.md +++ b/README.md @@ -362,6 +362,16 @@ Protocol for SOAP URL. Defaults to `https`. Number of FCGI instances (default: 2) +### LDAP + +#### *sympa_ldap_auth_enabled* + +Whether authentication through LDAP is enabled. Defaults to `false`. + +#### *sympa_ldap_auth_ssl* + +Whether authentication through LDAP uses SSL. Defaults to `true`. + ## Dependencies None. From f095e888064a1c606a0fadf967be5ea6b5a14aac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Vi=C3=B1ar=20Ulriksen?= Date: Wed, 13 Aug 2025 15:31:28 -0300 Subject: [PATCH 18/33] wwsympa_url instead of web_domain --- README.md | 2 +- templates/robot.conf.j2 | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3671c6a..950f048 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,7 @@ For example: *listmaster@lists.example.com*. With *sympa_robots* the role defines and populates the `robots.conf` files of a multi-domains Sympa server. -*sympa_robots* is a dict, where each key is the *domain* on which the robot operates (mail and web), and the value is a dict which defines the values of all the parameters of the robot. It may contain parameters such as listmaster, title, or any other [configuration parameter valid in a `robot.conf` file](https://www.sympa.community/gpldoc/man/sympa_config.5.html), with its associated value(s). +*sympa_robots* is a dict, where each key is the *domain* on which the robot operates (mail and web), and the value is a dict which defines the values of all the parameters of the robot. It may contain parameters such as `wwsympa_url`, `listmaster`, `title`, or any other [configuration parameter valid in a `robot.conf` file](https://www.sympa.community/gpldoc/man/sympa_config.5.html), with its associated value(s). *listmaster* can be defined as an ansible list of emails, or as a string of comma separated email addresses. Compound paramentes can be defined as sub-dicts. For instance: ``` diff --git a/templates/robot.conf.j2 b/templates/robot.conf.j2 index 2721619..0fc315c 100644 --- a/templates/robot.conf.j2 +++ b/templates/robot.conf.j2 @@ -11,13 +11,13 @@ listmaster listmaster@{{ sympa_robot_domain }} {% if sympa_web_fcgi_enabled %} # Web interface -wwsympa_url {{ sympa_web_fcgi_protocol }}://{{ sympa_robot.web_domain | default(sympa_robot_domain) }}/{{ sympa_web_path }} -cookie_domain {{ sympa_robot.web_domain | default(sympa_robot_domain) }} +wwsympa_url {{ sympa_web_fcgi_protocol }}://{{ sympa_robot.wwsympa_url | default(sympa_robot.web_domain) | default(sympa_robot_domain) }}/{{ sympa_web_path }} +cookie_domain {{ sympa_robot.wwsympa_url | default(sympa_robot.web_domain) | default(sympa_robot_domain) }} {% endif %} {% for robot_param,value in sympa_robot.items() %} -{% if robot_param != 'domain' and robot_param != 'listmaster' %} +{% if not robot_param in ['domain', 'listmaster', 'wwsympa_url', 'web_domain'] %} {% if value is mapping %} # {{ robot_param }} value(s) From a9fb16fb7429db2d9f4d9c9e958660b4b6edcc50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Vi=C3=B1ar=20Ulriksen?= Date: Thu, 21 Aug 2025 14:37:20 -0300 Subject: [PATCH 19/33] sympa_robots default as empty dict, not list --- defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 15215b9..61066c4 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -162,7 +162,7 @@ sympa_soap_nginx_snippet: | fastcgi_pass unix:/run/sympasoap/sympasoap.socket; } -sympa_robots: [] +sympa_robots: {} sympa_install_odbc_driver: false From 8340e19d6855c59fb0d4734e239c3d38282d233a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Vi=C3=B1ar=20Ulriksen?= Date: Thu, 28 Aug 2025 12:07:24 -0300 Subject: [PATCH 20/33] if dkim_feature, config dkim requirements --- defaults/main.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 61066c4..784c75f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -54,8 +54,6 @@ sympa_config_sendmail: /usr/sbin/sendmail sympa_config_sendmail_aliases: /etc/mail/sympa/aliases sympa_config_shared_feature: 'on' -sympa_config_dkim_feature: false - sympa_edit_list_defaults: - role: privileged_owner privilege: write @@ -168,7 +166,11 @@ sympa_install_odbc_driver: false sympa_rsyslog_unix_user: "{{ sympa_unix_user }}" + sympa_dkim_feature: false + +sympa_config_dkim_feature: '{{ sympa_dkim_feature }}' + sympa_dkim_add_signature_to: - robot - list From b63c87bbb503a745bb24adf43f0be158b2bf73ff Mon Sep 17 00:00:00 2001 From: Francisco Zadikian Date: Tue, 2 Sep 2025 15:28:01 -0300 Subject: [PATCH 21/33] rename ldaps variable --- README.md | 4 ++-- defaults/main.yml | 7 ++++--- tasks/perl-modules.yml | 6 +++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 8a35942..5dfc0bd 100644 --- a/README.md +++ b/README.md @@ -368,9 +368,9 @@ Number of FCGI instances (default: 2) Whether authentication through LDAP is enabled. Defaults to `false`. -#### *sympa_ldap_auth_ssl* +#### *sympa_ldap_auth_secure* -Whether authentication through LDAP uses SSL. Defaults to `true`. +Whether authentication through LDAP is secure. Defaults to `true`. ## Dependencies diff --git a/defaults/main.yml b/defaults/main.yml index 784c75f..748c6d1 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -133,12 +133,13 @@ sympa_soap_fcgi_protocol: https sympa_soap_fcgi_instances: 2 sympa_ldap_auth_enabled: false -sympa_ldap_auth_ssl: true +sympa_ldap_auth_secure: true sympa_web_nginx_snippet: | location = / { return 301 /{{ sympa_web_path }}; } + location /{{ sympa_web_path }} { include fastcgi_params; fastcgi_pass unix:{{ sympa_web_fcgi_socket }}; @@ -166,14 +167,14 @@ sympa_install_odbc_driver: false sympa_rsyslog_unix_user: "{{ sympa_unix_user }}" - sympa_dkim_feature: false -sympa_config_dkim_feature: '{{ sympa_dkim_feature }}' +sympa_config_dkim_feature: '{{ sympa_dkim_feature }}' sympa_dkim_add_signature_to: - robot - list + sympa_dkim_private_key_path: /etc/ssl/dkim_private.key sympa_dkim_signature_apply_on: - md5_authenticated_messages diff --git a/tasks/perl-modules.yml b/tasks/perl-modules.yml index f762dc7..01639d0 100644 --- a/tasks/perl-modules.yml +++ b/tasks/perl-modules.yml @@ -47,7 +47,7 @@ name: - "{{ sympa_openssldev_package }}" - "{{ sympa_zlibdev_package }}" - when: sympa_ldap_auth_enabled and sympa_ldap_auth_ssl + when: sympa_ldap_auth_enabled and sympa_ldap_auth_secure tags: sympaldap - name: Add Mail::DKIM::Verifier to features if DKIM support is requested @@ -69,13 +69,13 @@ - name: Add ldap-secure to features if LDAP (ssl) auth is enabled set_fact: sympa_cpanm_features: "{{ sympa_cpanm_features + ['ldap-secure'] }}" - when: sympa_ldap_auth_enabled and sympa_ldap_auth_ssl + when: sympa_ldap_auth_enabled and sympa_ldap_auth_secure tags: sympaldap - name: Add ldap to features if LDAP (no SSL) auth is enabled set_fact: sympa_cpanm_features: "{{ sympa_cpanm_features + ['ldap'] }}" - when: sympa_ldap_auth_enabled and not sympa_ldap_auth_ssl + when: sympa_ldap_auth_enabled and not sympa_ldap_auth_secure tags: sympaldap - name: Print features before install From f2f7e0069c9a8f01a28cf69083a15bb2a875608a Mon Sep 17 00:00:00 2001 From: Francisco Date: Fri, 5 Sep 2025 13:45:48 -0300 Subject: [PATCH 22/33] follow DRY principle for dkim_signature_apply_on --- defaults/main.yml | 8 +++----- templates/sympa.conf.j2 | 3 --- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 748c6d1..f2f3da8 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -176,8 +176,6 @@ sympa_dkim_add_signature_to: - list sympa_dkim_private_key_path: /etc/ssl/dkim_private.key -sympa_dkim_signature_apply_on: - - md5_authenticated_messages - - smime_authenticated_messages - - dkim_authenticated_messages - - editor_validated_messages + +# sympa_dkim_signature_apply_on: +# - any diff --git a/templates/sympa.conf.j2 b/templates/sympa.conf.j2 index 032ec93..8490bee 100644 --- a/templates/sympa.conf.j2 +++ b/templates/sympa.conf.j2 @@ -156,8 +156,6 @@ dkim_feature {% if sympa_dkim_feature %}on{% else %}off{% endif %} ## "dkim_authenticated_messages", "editor_validated_messages". {% if sympa_dkim_signature_apply_on | length>0 %} dkim_signature_apply_on {{ sympa_dkim_signature_apply_on | join(',') }} -{% else %} -dkim_signature_apply_on none {% endif %} ## dkim_private_key_path @@ -171,7 +169,6 @@ dkim_parameters.signer_domain {{ sympa_dkim_signer_domain }} {% endif %} ## dkim_selector -## The selector {% if sympa_dkim_selector is defined %} dkim_parameters.selector {{ sympa_dkim_selector }} {% endif %} From 6f70d93206d90636c2f655c88f21e566b1621858 Mon Sep 17 00:00:00 2001 From: Paulo Ruiz Date: Thu, 7 Aug 2025 19:55:52 -0300 Subject: [PATCH 23/33] Update sympa.conf template to use DKIM --- defaults/main.yml | 11 +++++++++++ templates/sympa.conf.j2 | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index eb59288..c7d5175 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -162,3 +162,14 @@ sympa_soap_nginx_snippet: | sympa_install_odbc_driver: false sympa_rsyslog_unix_user: "{{ sympa_unix_user }}" + +sympa_dkim_feature: false +sympa_dkim_add_signature_to: + - robot + - list +sympa_dkim_private_key_path: /etc/ssl/dkim_private.key +sympa_dkim_signature_apply_on: + - md5_authenticated_messages + - smime_authenticated_messages + - dkim_authenticated_messages + - editor_validated_messages diff --git a/templates/sympa.conf.j2 b/templates/sympa.conf.j2 index 7ffbb02..71c9d1d 100644 --- a/templates/sympa.conf.j2 +++ b/templates/sympa.conf.j2 @@ -139,3 +139,35 @@ process_archive {{ sympa_config_process_archive | bool | ternary('on', 'off') }} # Extra parameters {{ sympa_config_extra_parameters }} {% endif %} + +###\\\\ DKIM ////### + +## dkim_feature +dkim_feature {% if sympa_dkim_feature %}on{% else %}off{% endif %} + +## dkim_signature_apply_on +## Type of message that is added a DKIM signature before distribution to +## subscribers. Possible values are "none", "any" or a list of the following +## keywords: "md5_authenticated_messages", "smime_authenticated_messages", +## "dkim_authenticated_messages", "editor_validated_messages". +{% if sympa_dkim_signature_apply_on | length>0 %} +dkim_signature_apply_on {{ sympa_dkim_signature_apply_on | join(',') }} +{% else %} +dkim_signature_apply_on none +{% endif %} + +## dkim_private_key_path +## Location of the file where DKIM private key is stored +dkim_parameters.private_key_path {{ sympa_dkim_private_key_path }} + +## dkim_signer_domain +## The "d=" tag as defined in rfc 4871, default is virtual host domain name +{% if sympa_dkim_signer_domain is defined %} +dkim_parameters.signer_domain {{ sympa_dkim_signer_domain }} +{% endif %} + +## dkim_selector +## The selector +{% if sympa_dkim_selector is defined %} +dkim_parameters.selector {{ sympa_dkim_selector }} +{% endif %} From a286266d6619bae6b984c83014053f73061320c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Vi=C3=B1ar=20Ulriksen?= Date: Thu, 28 Aug 2025 12:07:24 -0300 Subject: [PATCH 24/33] if dkim_feature, config dkim requirements --- defaults/main.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index c7d5175..cd663f3 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -54,8 +54,6 @@ sympa_config_sendmail: /usr/sbin/sendmail sympa_config_sendmail_aliases: /etc/mail/sympa/aliases sympa_config_shared_feature: 'on' -sympa_config_dkim_feature: false - sympa_edit_list_defaults: - role: privileged_owner privilege: write @@ -164,6 +162,9 @@ sympa_install_odbc_driver: false sympa_rsyslog_unix_user: "{{ sympa_unix_user }}" sympa_dkim_feature: false + +sympa_config_dkim_feature: '{{ sympa_dkim_feature }}' + sympa_dkim_add_signature_to: - robot - list From 17846bc7aa18080355ac8a862733be314d74b507 Mon Sep 17 00:00:00 2001 From: Francisco Date: Fri, 5 Sep 2025 13:45:48 -0300 Subject: [PATCH 25/33] respect sympa defaults, add missing dkim_add_signature_to variable to template --- defaults/main.yml | 18 +++++++++--------- templates/sympa.conf.j2 | 21 +++++++++++++-------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index cd663f3..3e8ebe6 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -162,15 +162,15 @@ sympa_install_odbc_driver: false sympa_rsyslog_unix_user: "{{ sympa_unix_user }}" sympa_dkim_feature: false +sympa_config_dkim_feature: '{{ sympa_dkim_feature }}' # config requirements if dkim enabled -sympa_config_dkim_feature: '{{ sympa_dkim_feature }}' +# sympa_dkim_add_signature_to: +# - robot +# - list +# sympa_dkim_signature_apply_on: +# - any -sympa_dkim_add_signature_to: - - robot - - list sympa_dkim_private_key_path: /etc/ssl/dkim_private.key -sympa_dkim_signature_apply_on: - - md5_authenticated_messages - - smime_authenticated_messages - - dkim_authenticated_messages - - editor_validated_messages + +# sympa_dkim_signer_domain: lists.example.org +# sympa_dkim_selector: sympa diff --git a/templates/sympa.conf.j2 b/templates/sympa.conf.j2 index 71c9d1d..8cbd04d 100644 --- a/templates/sympa.conf.j2 +++ b/templates/sympa.conf.j2 @@ -140,34 +140,39 @@ process_archive {{ sympa_config_process_archive | bool | ternary('on', 'off') }} {{ sympa_config_extra_parameters }} {% endif %} -###\\\\ DKIM ////### +## DKIM +# adapted from stuvusIT/sympa repository on Github ## dkim_feature dkim_feature {% if sympa_dkim_feature %}on{% else %}off{% endif %} +## dkim_add_signature_to +## Which service messages to be signed +## Inserts a DKIM signature to service messages in context of robot, list or both +{% if sympa_dkim_add_signature_to is defined %} +dkim_add_signature_to {{ sympa_dkim_add_signature_to | join(',') }} +{% endif %} + ## dkim_signature_apply_on ## Type of message that is added a DKIM signature before distribution to ## subscribers. Possible values are "none", "any" or a list of the following ## keywords: "md5_authenticated_messages", "smime_authenticated_messages", ## "dkim_authenticated_messages", "editor_validated_messages". -{% if sympa_dkim_signature_apply_on | length>0 %} +{% if sympa_dkim_signature_apply_on is defined %} dkim_signature_apply_on {{ sympa_dkim_signature_apply_on | join(',') }} -{% else %} -dkim_signature_apply_on none {% endif %} -## dkim_private_key_path +## dkim_parameters.private_key_path ## Location of the file where DKIM private key is stored dkim_parameters.private_key_path {{ sympa_dkim_private_key_path }} -## dkim_signer_domain +## dkim_parameters.signer_domain ## The "d=" tag as defined in rfc 4871, default is virtual host domain name {% if sympa_dkim_signer_domain is defined %} dkim_parameters.signer_domain {{ sympa_dkim_signer_domain }} {% endif %} -## dkim_selector -## The selector +## dkim_parameters.selector {% if sympa_dkim_selector is defined %} dkim_parameters.selector {{ sympa_dkim_selector }} {% endif %} From 7214997e809bd902f2c0a830cb40f5cb840c37cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Vi=C3=B1ar=20Ulriksen?= Date: Mon, 8 Sep 2025 18:43:42 -0300 Subject: [PATCH 26/33] sympa_config_extra_parameters as a dict --- README.md | 7 ++++++ templates/robot.conf.j2 | 22 +++++++++---------- templates/sympa.conf.j2 | 48 +++++++++++++++++++++++++++++------------ 3 files changed, 52 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 5dfc0bd..3cf8b0a 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,13 @@ If no value is provided, `listmaster` will be joined with a @ to the For example: *listmaster@lists.example.com*. +### sympa.conf + +As *sympa_listmaster* described hereabove, several variables described hereafter set a parameter in *sympa.conf* configuration file. For [those parameters avaialable for *sympa.conf*](https://www.sympa.community/gpldoc/man/sympa_config.5.html) which have not (yet) a variable associated in this role, it proposes the composed variable *sympa_config_extra_parameters*, which can contain either: + +* for backwards compatibility: a multiline string, which is simply appended to *sympa.conf*, +* a dict describing sympa parameters, similar to *sympa_robots* elements described hereafter. + ### Sympa robots #### *sympa_robots* diff --git a/templates/robot.conf.j2 b/templates/robot.conf.j2 index 0fc315c..99da8c0 100644 --- a/templates/robot.conf.j2 +++ b/templates/robot.conf.j2 @@ -15,18 +15,18 @@ wwsympa_url {{ sympa_web_fcgi_protocol }}://{{ sympa_robot.wwsympa_url | default cookie_domain {{ sympa_robot.wwsympa_url | default(sympa_robot.web_domain) | default(sympa_robot_domain) }} {% endif %} -{% for robot_param,value in sympa_robot.items() %} +{% for robot_param,value in sympa_robot.items() %} -{% if not robot_param in ['domain', 'listmaster', 'wwsympa_url', 'web_domain'] %} +{% if not robot_param in ['domain', 'listmaster', 'wwsympa_url', 'web_domain'] %} -{% if value is mapping %} -# {{ robot_param }} value(s) -{% for sub_el,val in value.items() -%} - {{ robot_param }}.{{ sub_el }} {{ val }} -{% endfor %} -{% else %} -# {{ robot_param }} value -{{ robot_param }} {{ value }} +{% if value is mapping %} +# {{ robot_param }} value(s) +{% for sub_el,val in value.items() -%} + {{ robot_param }}.{{ sub_el }} {{ val }} +{% endfor %} +{% else %} +# {{ robot_param }} value +{{ robot_param }} {{ value }} +{%- endif %} {%- endif %} -{%- endif %} {%- endfor %} diff --git a/templates/sympa.conf.j2 b/templates/sympa.conf.j2 index 3a51ac5..37531ef 100644 --- a/templates/sympa.conf.j2 +++ b/templates/sympa.conf.j2 @@ -114,41 +114,36 @@ alias_manager {{ sympa_config_alias_manager }} {% if sympa_config_aliases_program is defined %} aliases_program {{ sympa_config_aliases_program }} {% endif %} - {% if sympa_config_aliases_db_type is defined %} + aliases_db_type {{ sympa_config_aliases_db_type }} {% endif %} - {% if sympa_config_aliases_wrapper is defined %} + aliases_wrapper {{ sympa_config_aliases_wrapper }} {% endif %} +{% if sympa_config_max_size is defined %} ## Incoming email -{% if sympa_config_max_size is defined %} max_size {{ sympa_config_max_size }} {% endif %} +{% if sympa_config_merge_feature is defined %} ## Personalization -{% if sympa_config_merge_feature is defined %} merge_feature {{ sympa_config_merge_feature | bool | ternary('on', 'off') }} {% endif %} +{% if sympa_installation_method != 'package' %} # Archiving -{% if sympa_installation_method != 'package' %} mhonarc /usr/local/bin/mhonarc {% endif %} process_archive {{ sympa_config_process_archive | bool | ternary('on', 'off') }} -{% if sympa_config_extra_parameters is defined %} - -# Extra parameters -{{ sympa_config_extra_parameters }} -{% endif %} ## DKIM # adapted from stuvusIT/sympa repository on Github ## dkim_feature -dkim_feature {% if sympa_dkim_feature %}on{% else %}off{% endif %} +dkim_feature {{ sympa_dkim_feature | bool | ternary('on', 'off') }} ## dkim_add_signature_to ## Which service messages to be signed @@ -157,26 +152,51 @@ dkim_feature {% if sympa_dkim_feature %}on{% else %}off{% endif %} dkim_add_signature_to {{ sympa_dkim_add_signature_to | join(',') }} {% endif %} +{% if sympa_dkim_signature_apply_on | default([]) | length > 0 %} ## dkim_signature_apply_on ## Type of message that is added a DKIM signature before distribution to ## subscribers. Possible values are "none", "any" or a list of the following ## keywords: "md5_authenticated_messages", "smime_authenticated_messages", ## "dkim_authenticated_messages", "editor_validated_messages". -{% if sympa_dkim_signature_apply_on is defined %} dkim_signature_apply_on {{ sympa_dkim_signature_apply_on | join(',') }} +{% else %} +# dkim_signature_apply_on defaults is: md5_authenticated_messages,smime_authenticated_messages,dkim_authenticated_messages,editor_validated_messages {% endif %} ## dkim_parameters.private_key_path +{% if sympa_dkim_private_key_path is defined %} ## Location of the file where DKIM private key is stored dkim_parameters.private_key_path {{ sympa_dkim_private_key_path }} +{% endif %} +{% if sympa_dkim_signer_domain is defined %} ## dkim_parameters.signer_domain ## The "d=" tag as defined in rfc 4871, default is virtual host domain name -{% if sympa_dkim_signer_domain is defined %} dkim_parameters.signer_domain {{ sympa_dkim_signer_domain }} {% endif %} +{% if sympa_dkim_selector is defined %} ## dkim_parameters.selector -{% if sympa_dkim_selector is defined %} dkim_parameters.selector {{ sympa_dkim_selector }} {% endif %} +{% if sympa_config_extra_parameters is defined %} + +# Extra parameters +{% if sympa_config_extra_parameters is mapping %} +{% for sympa_param,value in sympa_config_extra_parameters.items() %} + +{% if value is mapping %} +# {{ sympa_param }} value(s) +{% for sub_el,val in value.items() -%} + {{ sympa_param }}.{{ sub_el }} {{ val }} +{% endfor %} +{% else %} +# {{ sympa_param }} value +{{ sympa_param }} {{ value }} +{%- endif %} +{%- endfor %} +{% else %}{# then sympa_config_extra_parameters is a multiline string - for backwards compatibility #} +{{ sympa_config_extra_parameters }} +{% endif %} +{% endif %} + From a0893420fc2f5ba334dbc9fa25a6e6894cc6450e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Vi=C3=B1ar=20Ulriksen?= Date: Tue, 9 Sep 2025 09:25:20 -0300 Subject: [PATCH 27/33] accept string instead of list parameter --- templates/sympa.conf.j2 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/sympa.conf.j2 b/templates/sympa.conf.j2 index 37531ef..82407ba 100644 --- a/templates/sympa.conf.j2 +++ b/templates/sympa.conf.j2 @@ -158,7 +158,11 @@ dkim_add_signature_to {{ sympa_dkim_add_signature_to | join(',') }} ## subscribers. Possible values are "none", "any" or a list of the following ## keywords: "md5_authenticated_messages", "smime_authenticated_messages", ## "dkim_authenticated_messages", "editor_validated_messages". +{% if sympa_dkim_signature_apply_on is string %} +dkim_signature_apply_on {{ sympa_dkim_signature_apply_on }} +{% else %}{# dkim_signature_apply_on is a list #} dkim_signature_apply_on {{ sympa_dkim_signature_apply_on | join(',') }} +{% endif %} {% else %} # dkim_signature_apply_on defaults is: md5_authenticated_messages,smime_authenticated_messages,dkim_authenticated_messages,editor_validated_messages {% endif %} @@ -199,4 +203,3 @@ dkim_parameters.selector {{ sympa_dkim_selector }} {{ sympa_config_extra_parameters }} {% endif %} {% endif %} - From 29a605edadf9e365e1b4ddc38fdee5bbe2d0ec2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Vi=C3=B1ar=20Ulriksen?= Date: Tue, 9 Sep 2025 16:53:41 -0300 Subject: [PATCH 28/33] templates and vars: list or strings as jinja macro --- templates/robot.conf.j2 | 11 ++++++++--- templates/sympa.conf.j2 | 23 +++++++++++------------ 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/templates/robot.conf.j2 b/templates/robot.conf.j2 index 99da8c0..00092a6 100644 --- a/templates/robot.conf.j2 +++ b/templates/robot.conf.j2 @@ -1,9 +1,14 @@ +{# Macro to accept multi-value parameters as comma separated string or yaml list #} +{% macro sympa_string_or_list(sympa_param, sympa_param_value) -%} +{{ sympa_param }} {% if sympa_param_value is string %}{{ sympa_param_value }}{% else %}{{ sympa_param_value | join(',') }}{% endif %} +{%- endmacro %} + # Robot configuration for {{ sympa_robot_domain }} domain {{ sympa_robot_domain }} # Robot's listmaster {% if sympa_robot.listmaster is defined %} -listmaster {% if sympa_robot.listmaster is string %}{{ sympa_robot.listmaster }}{% else %}{{ sympa_robot.listmaster | join(',') }}{% endif %} +{{ sympa_string_or_list('listmaster', sympa_robot.listmaster) }} {% else %} listmaster listmaster@{{ sympa_robot_domain }} {% endif %} @@ -22,11 +27,11 @@ cookie_domain {{ sympa_robot.wwsympa_url | default(sympa_robot.web_domain) | def {% if value is mapping %} # {{ robot_param }} value(s) {% for sub_el,val in value.items() -%} - {{ robot_param }}.{{ sub_el }} {{ val }} +{{ sympa_string_or_list( robot_param + '.' + sub_el, val ) }} {% endfor %} {% else %} # {{ robot_param }} value -{{ robot_param }} {{ value }} +{{ sympa_string_or_list( robot_param, value ) }} {%- endif %} {%- endif %} {%- endfor %} diff --git a/templates/sympa.conf.j2 b/templates/sympa.conf.j2 index 82407ba..0cd8888 100644 --- a/templates/sympa.conf.j2 +++ b/templates/sympa.conf.j2 @@ -1,11 +1,13 @@ +{# Macro to accept multi-value parameters as comma separated string or yaml list #} +{% macro sympa_string_or_list(sympa_param, sympa_param_value) -%} +{{ sympa_param }} {% if sympa_param_value is string %}{{ sympa_param_value }}{% else %}{{ sympa_param_value | join(',') }}{% endif %} +{%- endmacro %} # Main domain - domain {{ sympa_domain }} # Listmaster - {% if sympa_listmaster is defined %} -listmaster {% if sympa_listmaster is string %}{{ sympa_listmaster }}{% else %}{{ sympa_listmaster | join(',') }}{% endif %} +{{ sympa_string_or_list('listmaster', sympa_listmaster) }} {% else %} listmaster listmaster@{{ sympa_domain }} {% endif %} @@ -14,6 +16,7 @@ listmaster listmaster@{{ sympa_domain }} # Web interface wwsympa_url {{ sympa_web_fcgi_protocol }}://{{ sympa_web_domain | default(sympa_domain) }}/{{ sympa_web_path }} {% if sympa_config_title is defined %} + title {{ sympa_config_title }} {% endif %} {% if sympa_config_favicon_url is defined %} @@ -98,7 +101,7 @@ create_list {{ sympa_config_create_list }} lang {{ sympa_config_lang }} {% endif %} {% if sympa_config_supported_lang is defined %} -supported_lang {% if sympa_config_supported_lang is string %}{{ sympa_config_supported_lang }}{% else %}{{ sympa_config_supported_lang | join(',') }}{% endif %} +{{ sympa_string_or_list('supported_lang', sympa_config_supported_lang ) }} {% endif %} # Email distribution settings @@ -149,7 +152,7 @@ dkim_feature {{ sympa_dkim_feature | bool | ternary('on', 'off') }} ## Which service messages to be signed ## Inserts a DKIM signature to service messages in context of robot, list or both {% if sympa_dkim_add_signature_to is defined %} -dkim_add_signature_to {{ sympa_dkim_add_signature_to | join(',') }} +{{ sympa_string_or_list('dkim_add_signature_to', sympa_dkim_add_signature_to ) }} {% endif %} {% if sympa_dkim_signature_apply_on | default([]) | length > 0 %} @@ -158,11 +161,7 @@ dkim_add_signature_to {{ sympa_dkim_add_signature_to | join(',') }} ## subscribers. Possible values are "none", "any" or a list of the following ## keywords: "md5_authenticated_messages", "smime_authenticated_messages", ## "dkim_authenticated_messages", "editor_validated_messages". -{% if sympa_dkim_signature_apply_on is string %} -dkim_signature_apply_on {{ sympa_dkim_signature_apply_on }} -{% else %}{# dkim_signature_apply_on is a list #} -dkim_signature_apply_on {{ sympa_dkim_signature_apply_on | join(',') }} -{% endif %} +{{ sympa_string_or_list('dkim_signature_apply_on', sympa_dkim_signature_apply_on ) }} {% else %} # dkim_signature_apply_on defaults is: md5_authenticated_messages,smime_authenticated_messages,dkim_authenticated_messages,editor_validated_messages {% endif %} @@ -192,11 +191,11 @@ dkim_parameters.selector {{ sympa_dkim_selector }} {% if value is mapping %} # {{ sympa_param }} value(s) {% for sub_el,val in value.items() -%} - {{ sympa_param }}.{{ sub_el }} {{ val }} +{{ sympa_string_or_list( sympa_param + '.' + sub_el, val ) }} {% endfor %} {% else %} # {{ sympa_param }} value -{{ sympa_param }} {{ value }} +{{ sympa_string_or_list( sympa_param, value ) }} {%- endif %} {%- endfor %} {% else %}{# then sympa_config_extra_parameters is a multiline string - for backwards compatibility #} From f163afd194a8513937cc2850c66202bac8d93596 Mon Sep 17 00:00:00 2001 From: Francisco Date: Wed, 10 Sep 2025 16:49:15 -0300 Subject: [PATCH 29/33] workaround dbtype for postgresql --- templates/dbconfig-common.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/dbconfig-common.j2 b/templates/dbconfig-common.j2 index f9d9247..5ff29ae 100644 --- a/templates/dbconfig-common.j2 +++ b/templates/dbconfig-common.j2 @@ -1,7 +1,7 @@ dbc_install='true' dbc_upgrade='true' dbc_remove='' -dbc_dbtype='{{ sympa_database.type | lower }}' +dbc_dbtype='{{ "pgsql" if sympa_database.type | lower == "postgresql" else sympa_database.type | lower }}' dbc_dbuser='{{ sympa_database.user }}' dbc_dbpass='{{ sympa_database.password | default("") }}' dbc_dbserver='{{ sympa_database.host | default("") }}' From 2bff66cab8e24ae20cb93520afd52f526410a1ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Vi=C3=B1ar=20Ulriksen?= Date: Fri, 12 Sep 2025 17:39:43 -0300 Subject: [PATCH 30/33] no arc folder per robot, set attributes to existing elementi in install folder --- tasks/config-make-install.yml | 1 + tasks/robot.yml | 8 -------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/tasks/config-make-install.yml b/tasks/config-make-install.yml index 1411a0c..fc4e1e2 100644 --- a/tasks/config-make-install.yml +++ b/tasks/config-make-install.yml @@ -9,6 +9,7 @@ owner: "{{ sympa_unix_user }}" group: "{{ sympa_unix_group }}" mode: 0755 + recurse: true - name: Ensure that configuration directory exists file: diff --git a/tasks/robot.yml b/tasks/robot.yml index 43e0b9d..45ce610 100644 --- a/tasks/robot.yml +++ b/tasks/robot.yml @@ -18,14 +18,6 @@ group: "{{ sympa_unix_group }}" mode: 0755 -- name: Create archives' directory {{ sympa_robot_domain }} robot - file: - state: directory - path: "{{ sympa_installation_directory }}/arc/{{ sympa_robot_domain }}" - owner: "{{ sympa_unix_user }}" - group: "{{ sympa_unix_group }}" - mode: 0755 - - debug: var: "{{ item }}" verbosity: 2 From 9f3af37209f58b7fa5f110752663f08b605a3da0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Vi=C3=B1ar=20Ulriksen?= Date: Mon, 15 Sep 2025 13:05:38 -0300 Subject: [PATCH 31/33] accepitng sympa_robots elements only with domain key --- templates/robot.conf.j2 | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/templates/robot.conf.j2 b/templates/robot.conf.j2 index 00092a6..5ccbd57 100644 --- a/templates/robot.conf.j2 +++ b/templates/robot.conf.j2 @@ -20,18 +20,20 @@ wwsympa_url {{ sympa_web_fcgi_protocol }}://{{ sympa_robot.wwsympa_url | default cookie_domain {{ sympa_robot.wwsympa_url | default(sympa_robot.web_domain) | default(sympa_robot_domain) }} {% endif %} -{% for robot_param,value in sympa_robot.items() %} +{% if sympa_robot is mapping %} +{% for robot_param,value in sympa_robot.items() %} -{% if not robot_param in ['domain', 'listmaster', 'wwsympa_url', 'web_domain'] %} - -{% if value is mapping %} -# {{ robot_param }} value(s) -{% for sub_el,val in value.items() -%} -{{ sympa_string_or_list( robot_param + '.' + sub_el, val ) }} -{% endfor %} -{% else %} -# {{ robot_param }} value -{{ sympa_string_or_list( robot_param, value ) }} +{% if not robot_param in ['domain', 'listmaster', 'wwsympa_url', 'web_domain'] %} + +{% if value is mapping %} +# {{ robot_param }} value(s) +{% for sub_el,val in value.items() -%} +{{ sympa_string_or_list( robot_param + '.' + sub_el, val ) }} +{% endfor %} +{% else %} +# {{ robot_param }} value +{{ sympa_string_or_list( robot_param, value ) }} +{%- endif %} {%- endif %} -{%- endif %} -{%- endfor %} +{%- endfor %} +{%- endif %} From 592b602ac353f8d2317613f0ac097628378c8436 Mon Sep 17 00:00:00 2001 From: Francisco Zadikian Date: Tue, 30 Sep 2025 21:12:02 -0300 Subject: [PATCH 32/33] fix bug from when expression --- tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index 98ee07a..7725013 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -184,7 +184,7 @@ mode: 0640 when: - sympa_topics is defined - - sympa_topics | count + - sympa_topics | count > 0 notify: - restart sympa - restart wwsympa From af2f987b039b9181a5cf1875805de04bdd7e9803 Mon Sep 17 00:00:00 2001 From: Francisco Zadikian Date: Thu, 9 Oct 2025 17:26:23 -0300 Subject: [PATCH 33/33] fix more conditionals containing 'count' --- tasks/config-make-install.yml | 2 +- tasks/source.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/config-make-install.yml b/tasks/config-make-install.yml index fc4e1e2..0aa723f 100644 --- a/tasks/config-make-install.yml +++ b/tasks/config-make-install.yml @@ -35,7 +35,7 @@ become_user: "{{ sympa_unix_user }}" vars: ansible_ssh_pipelining: true - when: sympa_installation_method != 'source' or sympa_source_patches | count + when: sympa_installation_method != 'source' or sympa_source_patches | count > 0 - name: Add symlink for pod2man on Arch Linux file: diff --git a/tasks/source.yml b/tasks/source.yml index 5c7b028..61ecc1f 100644 --- a/tasks/source.yml +++ b/tasks/source.yml @@ -43,7 +43,7 @@ - name: Ensure that patch binary is installed package: name: patch - when: sympa_source_patches | count + when: sympa_source_patches | count > 0 - name: Apply patches patch: