diff --git a/docs/releasenotes.rst b/docs/releasenotes.rst index ca2df54c9ae2cbd806e90c112fc4ba95ffa3673b..c9651ee3e317b3099fc7ceced7502192b46c9172 100644 --- a/docs/releasenotes.rst +++ b/docs/releasenotes.rst @@ -76,6 +76,11 @@ Upgraded to Ansible 10.4.x. Dropped support for Debian 11 requirements upgrade checks virtual environment that can happen if the initial virtual environment set-up fails. +* ``mail_forwarder`` role + + * Fixed incorrect use of inventory name instead of FQDN and hostname + for deployed files and configuration files. + * ``mail_server`` role * Fixed incorrect use of inventory name instead of FQDN and hostname diff --git a/roles/mail_forwarder/tasks/main.yml b/roles/mail_forwarder/tasks/main.yml index a8014e1295ce0294e00df60f54ed7dc33b872c5b..e6bba90fb4c4f961eba1aed41b5decf91c9b8fc7 100644 --- a/roles/mail_forwarder/tasks/main.yml +++ b/roles/mail_forwarder/tasks/main.yml @@ -36,7 +36,7 @@ - name: Configure visible mail name of the system ansible.builtin.copy: - content: "{{ inventory_hostname }}" + content: "{{ ansible_fqdn }}" dest: "/etc/mailname" owner: root group: root diff --git a/roles/mail_forwarder/templates/main.cf.j2 b/roles/mail_forwarder/templates/main.cf.j2 index 2be6f5126970be79ed07e624897a0958d02d4bea..d3e1f7d79e18a369c83ab59294415759c9384528 100644 --- a/roles/mail_forwarder/templates/main.cf.j2 +++ b/roles/mail_forwarder/templates/main.cf.j2 @@ -6,7 +6,7 @@ # ================ # Internet hostname of this mail system. -myhostname = {{ inventory_hostname }} +myhostname = {{ ansible_fqdn }} # Under Debian, when a file name is specified, the first line of the # file be used as the SMTP server name. @@ -45,7 +45,7 @@ compatibility_level = 3.6 # ====================== # List of domains for local transport deliveries. -mydestination = {{ inventory_hostname }}, {{ inventory_hostname_short }}, localhost.localdomain, localhost +mydestination = {{ ansible_fqdn }}, {{ ansible_hostname }}, localhost.localdomain, localhost # Alias maps for local deliveries (to system accounts). alias_maps = hash:/etc/aliases @@ -91,8 +91,8 @@ smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key # Use custom, generated DH parameters for increased security. -smtpd_tls_dh1024_param_file = /etc/ssl/private/{{ inventory_hostname }}_smtp.dh.pem -smtpd_tls_dh512_param_file = /etc/ssl/private/{{ inventory_hostname }}_smtp.dh.pem +smtpd_tls_dh1024_param_file = /etc/ssl/private/{{ ansible_fqdn }}_smtp.dh.pem +smtpd_tls_dh512_param_file = /etc/ssl/private/{{ ansible_fqdn }}_smtp.dh.pem {% if smtp_relay_host %} # Force TLS certificate validation when connecting to relay host using