소스 검색

Add an option to postfix configuration to not use the FQDN gathered by Ansible

Emmanuel Bouthenot 8 년 전
부모
커밋
99f03a4d86
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      roles/common/templates/postfix/main.cf.j2

+ 5 - 1
roles/common/templates/postfix/main.cf.j2

@@ -49,10 +49,14 @@ smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
 smtp_tls_session_cache_timeout = 3600
 smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
 
+{% if postfix_fqdn is defined %}
+myhostname = {{ postfix_fqdn }}
+{% else %}
 myhostname = {{ ansible_fqdn }}
+{% endif %}
 myorigin = $myhostname
 mydomain = $myhostname
-mydestination = {{ ansible_fqdn }} {{ ansible_hostname }} localhost localhost.localdomain
+mydestination = $myhostname {% if postfix_hostname is defined %}{{ postfix_hostname }}{% else %}{{ ansible_hostname }}{% endif %} localhost localhost.localdomain
 
 {% if smtp_relay_host is defined %}
 relayhost = {{ smtp_relay_host }}