restore lookup table logic
This commit is contained in:
parent
5281cec4c9
commit
45790af73b
@ -48,7 +48,7 @@
|
|||||||
{% for key in postfix_mail_domains[domain]['aliases']|default([]) -%}
|
{% for key in postfix_mail_domains[domain]['aliases']|default([]) -%}
|
||||||
{{ key.alias }} {{ key.dest }}
|
{{ key.alias }} {{ key.dest }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
dest: "{{ postfix_mail_domains[domain].user_lookup.file |
|
dest: "{{ postfix_mail_domains[domain].alias_lookup.file |
|
||||||
default('/etc/postfix/'+domain+'_aliases') |
|
default('/etc/postfix/'+domain+'_aliases') |
|
||||||
regex_replace('^/etc/postfix',postfix_mountpoint) }}"
|
regex_replace('^/etc/postfix',postfix_mountpoint) }}"
|
||||||
marker: "# {mark} ANSIBLE-MANAGED ALIASES"
|
marker: "# {mark} ANSIBLE-MANAGED ALIASES"
|
||||||
|
130
tasks/main.yml
130
tasks/main.yml
@ -105,57 +105,97 @@
|
|||||||
|
|
||||||
register: container
|
register: container
|
||||||
|
|
||||||
|
- name: Exportar informacion de container
|
||||||
|
set_fact:
|
||||||
|
postfix_container: "{{ lookup('vars','postfix_container') }}"
|
||||||
|
|
||||||
|
- when: postfix_volume[0] != '/'
|
||||||
|
block:
|
||||||
|
- name: Leer info de volumen {{ postfix_volume }}
|
||||||
|
docker_volume_info:
|
||||||
|
name: "{{ postfix_volume }}"
|
||||||
|
register: res_cfg
|
||||||
|
- name: Exportar informacion de volumen
|
||||||
|
set_fact:
|
||||||
|
postfix_volume: "{{ lookup('vars','postfix_volume') }}"
|
||||||
|
postfix_mountpoint: "{{ res_cfg.volume.Mountpoint }}"
|
||||||
|
|
||||||
|
- when: postfix_volume[0] == '/'
|
||||||
|
block:
|
||||||
|
- name: Exportar informacion de volumen
|
||||||
|
set_fact:
|
||||||
|
postfix_volume: "{{ lookup('vars','postfix_volume') }}"
|
||||||
|
postfix_mountpoint: "{{ lookup('vars','postfix_volume') }}"
|
||||||
|
|
||||||
|
- when: postfix_volume_ssl[0] != '/'
|
||||||
|
block:
|
||||||
|
- name: Leer info de volumen {{ postfix_volume_ssl }}
|
||||||
|
docker_volume_info:
|
||||||
|
name: "{{ postfix_volume_ssl }}"
|
||||||
|
register: res_ssl
|
||||||
|
- name: Exportar informacion de volumen
|
||||||
|
set_fact:
|
||||||
|
postfix_volume_ssl: "{{ lookup('vars','postfix_volume_ssl') }}"
|
||||||
|
postfix_mountpoint_ssl: "{{ res_ssl.volume.Mountpoint }}"
|
||||||
|
|
||||||
|
- when: postfix_volume_ssl[0] == '/'
|
||||||
|
block:
|
||||||
|
- name: Exportar informacion de volumen
|
||||||
|
set_fact:
|
||||||
|
postfix_volume_ssl: "{{ lookup('vars','postfix_volume_ssl') }}"
|
||||||
|
postfix_mountpoint_ssl: "{{ lookup('vars','postfix_volume_ssl') }}"
|
||||||
|
|
||||||
# FIXME: resolver access lists y tables en Docker
|
# FIXME: resolver access lists y tables en Docker
|
||||||
|
|
||||||
# - name: Configurar lookup tables
|
- name: Configurar lookup tables
|
||||||
# include_tasks: lookup_tables.yml
|
include_tasks: lookup_tables.yml
|
||||||
# loop: "{{ postfix_mail_domains.keys()|list }}"
|
loop: "{{ postfix_mail_domains.keys()|list }}"
|
||||||
# loop_control:
|
loop_control:
|
||||||
# loop_var: domain
|
loop_var: domain
|
||||||
|
|
||||||
# - name: Template client access list
|
- name: Template client access list
|
||||||
# blockinfile:
|
blockinfile:
|
||||||
# path: "{{ postfix_mountpoint }}/{{ postfix_rules_dir }}/client_access_list"
|
path: "{{ postfix_mountpoint }}/{{ postfix_rules_dir }}/client_access_list"
|
||||||
# create: yes
|
create: yes
|
||||||
# block: |
|
block: |
|
||||||
# # Edit host variable `postfix_client_access_list` to change these values
|
# Edit host variable `postfix_client_access_list` to change these values
|
||||||
# {% for entry in postfix_client_access_list -%}
|
{% for entry in postfix_client_access_list -%}
|
||||||
# {{ entry.regex }} {{ entry.action }}
|
{{ entry.regex }} {{ entry.action }}
|
||||||
# {% endfor %}
|
{% endfor %}
|
||||||
# notify: postmap access lists
|
notify: postmap access lists
|
||||||
|
|
||||||
# - name: Template helo access list
|
- name: Template helo access list
|
||||||
# blockinfile:
|
blockinfile:
|
||||||
# path: "{{ postfix_mountpoint }}/{{ postfix_rules_dir }}/helo_access_list"
|
path: "{{ postfix_mountpoint }}/{{ postfix_rules_dir }}/helo_access_list"
|
||||||
# create: yes
|
create: yes
|
||||||
# block: |
|
block: |
|
||||||
# # Edit host variable `postfix_helo_access_list` to change these values
|
# Edit host variable `postfix_helo_access_list` to change these values
|
||||||
# {% for entry in postfix_helo_access_list -%}
|
{% for entry in postfix_helo_access_list -%}
|
||||||
# {{ entry.host }} {{ entry.action }}
|
{{ entry.host }} {{ entry.action }}
|
||||||
# {% endfor %}
|
{% endfor %}
|
||||||
# notify: postmap access lists
|
notify: postmap access lists
|
||||||
|
|
||||||
# - name: Template recipient access list
|
- name: Template recipient access list
|
||||||
# blockinfile:
|
blockinfile:
|
||||||
# path: "{{ postfix_mountpoint }}/{{ postfix_rules_dir }}/recipient_access_list"
|
path: "{{ postfix_mountpoint }}/{{ postfix_rules_dir }}/recipient_access_list"
|
||||||
# create: yes
|
create: yes
|
||||||
# block: |
|
block: |
|
||||||
# # Edit host variable `postfix_recipient_access_list` to change these values
|
# Edit host variable `postfix_recipient_access_list` to change these values
|
||||||
# {% for entry in postfix_recipient_access_list -%}
|
{% for entry in postfix_recipient_access_list -%}
|
||||||
# {{ entry.rcpt }} {{ entry.action }}
|
{{ entry.rcpt }} {{ entry.action }}
|
||||||
# {% endfor %}
|
{% endfor %}
|
||||||
# notify: postmap access lists
|
notify: postmap access lists
|
||||||
|
|
||||||
# - name: Template sender access list
|
- name: Template sender access list
|
||||||
# blockinfile:
|
blockinfile:
|
||||||
# path: "{{ postfix_mountpoint }}/{{ postfix_rules_dir }}/sender_access_list"
|
path: "{{ postfix_mountpoint }}/{{ postfix_rules_dir }}/sender_access_list"
|
||||||
# create: yes
|
create: yes
|
||||||
# block: |
|
block: |
|
||||||
# # Edit host variable `postfix_sender_access_list` to change these values
|
# Edit host variable `postfix_sender_access_list` to change these values
|
||||||
# {% for entry in postfix_sender_access_list -%}
|
{% for entry in postfix_sender_access_list -%}
|
||||||
# {{ entry.sender }} {{ entry.action }}
|
{{ entry.sender }} {{ entry.action }}
|
||||||
# {% endfor %}
|
{% endfor %}
|
||||||
# notify: postmap access lists
|
notify: postmap access lists
|
||||||
|
|
||||||
# TODO: mensajes
|
# TODO: mensajes
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user