33 lines
974 B
YAML
33 lines
974 B
YAML
---
|
|
- name: Include OS specific vars
|
|
ansible.builtin.include_vars: "{{ var_files }}"
|
|
vars:
|
|
var_files: "{{ lookup('first_found', params, errors='ignore') }}"
|
|
params:
|
|
files:
|
|
- "{{ ansible_lsb.id | default('') | lower }}.yml"
|
|
- "{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version }}.yml"
|
|
- "{{ ansible_os_family | lower }}.yml"
|
|
paths:
|
|
- "vars"
|
|
when: var_files
|
|
- name: Install postfix
|
|
ansible.builtin.include_tasks: install.yml
|
|
- name: Configure postfix
|
|
ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}"
|
|
vars:
|
|
params:
|
|
files:
|
|
- "config_{{ ansible_lsb.id | default('') | lower }}.yml"
|
|
- "config_{{ ansible_os_family | lower }}.yml"
|
|
- "config_default.yml"
|
|
paths:
|
|
- "tasks"
|
|
|
|
- name: Ensure postfix service is up and running
|
|
ansible.builtin.service:
|
|
name: "postfix"
|
|
state: started
|
|
daemon_reload: True
|
|
enabled: True
|