mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-07-27 00:05:44 +02:00
Update to 2021-12-01 19:13
This commit is contained in:
32
roles/zimbra/tasks/proxy.yml
Normal file
32
roles/zimbra/tasks/proxy.yml
Normal file
@@ -0,0 +1,32 @@
|
||||
---
|
||||
|
||||
- name: Handle Zimbra proxy ports
|
||||
iptables_raw:
|
||||
name: zcs_proxy_ports
|
||||
state: present
|
||||
rules: "{% if zcs_http_src_ip | length > 0 %}-A INPUT -m state --state NEW -p tcp -m multiport --dports 80,443 -s {{ zcs_http_src_ip | join(',') }} -j ACCEPT\n{% endif %}
|
||||
{% if zcs_clients_src_ip | length > 0 %}-A INPUT -m state --state NEW -p tcp -m multiport --dports 110,995,143,993 -s {{ zcs_clients_src_ip | join(',') }} -j ACCEPT\n{% endif %}
|
||||
{% if zcs_admin_src_ip | length > 0 %}-A INPUT -m state --state NEW -p tcp -m multiport --dports 9071 -s {{ zcs_admin_src_ip | join(',') }} -j ACCEPT{% endif %}"
|
||||
when: iptables_manage | default(True)
|
||||
tags: zcs
|
||||
|
||||
- name: Enable proxy for the admin interface
|
||||
command: /opt/zimbra/bin/zmprov ms {{ inventory_hostname }} zimbraReverseProxyAdminEnabled TRUE
|
||||
changed_when: False
|
||||
become_user: zimbra
|
||||
tags: zcs
|
||||
|
||||
- name: Build a list of vhosts to be used for Let's Encrypt cert
|
||||
shell: |
|
||||
for DOMAIN in $(/opt/zimbra/bin/zmprov getAllDomains); do
|
||||
/opt/zimbra/bin/zmprov getDomain $DOMAIN zimbraVirtualHostname | perl -ne 'm/^zimbraVirtualHostname: (.*)/ && print "$1\n"'
|
||||
done
|
||||
become_user: zimbra
|
||||
register: zcs_vhosts
|
||||
changed_when: False
|
||||
when: zcs_letsencrypt == True
|
||||
tags: zcs
|
||||
- set_fact: zcs_vhosts={{ zcs_vhosts.stdout_lines }}
|
||||
when: zcs_vhosts.stdout_lines is defined
|
||||
tags: zcs
|
||||
|
Reference in New Issue
Block a user