Browse Source

postfix: add variables for relayhost, fqdn and mailname

keep-around/25df70063bfe6a756af43d2f1e00e4f145acd00e
Loïc Dachary 1 month ago
parent
commit
25df70063b
Signed by: dachary GPG Key ID: 992D23B392F9E4F2
  1. 31
      inventory/group_vars/all/postfix.yml
  2. 6
      playbooks/postfix/postfix-client-playbook.yml
  3. 2
      playbooks/postfix/postfix-relay-playbook.yml

31
inventory/group_vars/all/postfix.yml

@ -0,0 +1,31 @@
---
#
#############################################
#
# fqdn of the relay to which the client must send mail
#
postfix_client_relayhost: "{{ groups['postfix-service-group'][0] }}.{{ domain }}"
#
#############################################
#
# fqdn of the postfix client
#
postfix_client_fqdn: "{{ inventory_hostname }}.{{ domain }}"
#
#############################################
#
# /etc/mailname of the postfix client
#
postfix_client_mailname: '{{ domain }}'
#
#############################################
#
# fqdn of the postfix relay host
#
postfix_fqdn: "{{ inventory_hostname }}.{{ domain }}"
#
#############################################
#
# /etc/mailname of the postfix relay
#
postfix_mailname: '{{ domain }}'

6
playbooks/postfix/postfix-client-playbook.yml

@ -16,9 +16,9 @@
- '{{ postfix__secret__directories | d([ ])}}'
- role: debops.postfix
postfix__mailname: '{{ domain }}'
postfix__fqdn: '{{ inventory_hostname }}.{{ domain }}'
postfix__relayhost: "[{{ groups['postfix-service-group'][0] }}.{{ domain }}]:465"
postfix__mailname: '{{ postfix_mailname | default(domain) }}'
postfix__fqdn: '{{ postfix_fqdn | default(inventory_hostname + "." + domain) }}'
postfix__relayhost: '[{{ postfix_client_relayhost | default(groups["postfix-service-group"][0] + "." + domain) }}]:465'
postfix__maincf:
- name: 'smtpd_recipient_restrictions'
section: 'restrictions'

2
playbooks/postfix/postfix-relay-playbook.yml

@ -74,7 +74,7 @@
- role: debops.postfix
postfix__mailname: '{{ postfix_mailname | default(domain) }}'
postfix__fqdn: '{{ inventory_hostname }}.{{ domain }}'
postfix__fqdn: '{{ postfix_fqdn | default(inventory_hostname + "." + domain) }}'
postfix__mastercf:
- name: 'smtps'
state: 'present'

Loading…
Cancel
Save