diff --git a/defaults/main.yml b/defaults/main.yml index 329faf1..2317704 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,22 +1,22 @@ --- -postfix_hostname: '{{ ansible_fqdn }}' -postfix_origin: '$myhostname' +postfix_hostname: "{{ ansible_fqdn }}" +postfix_origin: "$myhostname" postfix_config: {} postfix_default_config: smtpd_banner: $myhostname ESMTP $mail_name (Debian/GNU) - biff: 'no' - append_dot_mydomain: 'no' - readme_directory: 'no' + biff: "no" + append_dot_mydomain: "no" + readme_directory: "no" compatibility_level: 2 - myhostname: '{{ ansible_fqdn }}' + myhostname: "{{ ansible_fqdn }}" myorigin: $myhostname mydestination: $myhostname, localhost default_transport: smtp mynetworks: 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 - mailbox_size_limit: '0' - recipient_delimiter: '+' + mailbox_size_limit: "0" + recipient_delimiter: "+" inet_interfaces: localhost inet_protocols: all -postfix_full_config: '{{ postfix_default_config|combine(postfix_config) }}' +postfix_full_config: "{{ postfix_default_config | combine(postfix_config) }}" postfix_transports: {} postfix_aliases: {} diff --git a/handlers/main.yml b/handlers/main.yml index 9f60728..098eb91 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,11 +1,11 @@ --- -- name: reload postfix +- name: Reload postfix ansible.builtin.service: name: postfix state: reloaded -- name: map transport +- name: Map transport # noqa no-changed-when ansible.builtin.command: postmap /etc/postfix/transport -- name: map aliases +- name: Map aliases # noqa no-changed-when ansible.builtin.command: postalias /etc/postfix/aliases diff --git a/meta/main.yml b/meta/main.yml index d7250c9..78615ab 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -6,7 +6,7 @@ galaxy_info: company: Adrien Waksberg description: Install and configure a simple mta with postfix license: Apache2 - min_ansible_version: 2.9 + min_ansible_version: "2.9" platforms: - name: Debian diff --git a/tasks/main.yml b/tasks/main.yml index c70c590..f2cea90 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,13 +1,13 @@ --- -- name: install packages +- name: Install packages ansible.builtin.package: name: - postfix - bsd-mailx tags: postfix -- name: copy file configuration - template: +- name: Copy file configuration + ansible.builtin.template: src: '{{ item }}.j2' dest: '/etc/postfix/{{ item }}' owner: root @@ -18,14 +18,14 @@ - aliases - transport notify: - - reload postfix - - map aliases - - map transport + - Reload postfix + - Map aliases + - Map transport tags: postfix -- name: enable and start service +- name: Enable and start service ansible.builtin.service: name: postfix - enabled: yes + enabled: true state: started tags: postfix