Skip to content

Commit ce1aa1d

Browse files
authored
Merge pull request #128 from Oefenweb/consistency-changes
Consistency changes
2 parents 24d1216 + dbb742e commit ce1aa1d

File tree

4 files changed

+39
-34
lines changed

4 files changed

+39
-34
lines changed

.ansible-lint

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
---
22
warn_list:
33
- role-name
4+
- name[play]
45
- name[casing]
5-
- '204'
6-
- '405'
7-
- '601'

.github/workflows/ci.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ jobs:
2323
python-version: '3.x'
2424

2525
- name: Install test dependencies
26-
run: pip install ansible-lint[community,yamllint]
26+
run: |
27+
pip install ansible-lint
28+
ansible-galaxy install -r requirements.yml
2729
2830
- name: Lint code
2931
run: |
@@ -43,11 +45,8 @@ jobs:
4345
matrix:
4446
include:
4547
- distro: debian8
46-
ansible-version: '<2.10'
4748
- distro: debian9
4849
- distro: debian10
49-
- distro: ubuntu1604
50-
ansible-version: '>=2.9, <2.10'
5150
- distro: ubuntu1604
5251
ansible-version: '>=2.10, <2.11'
5352
- distro: ubuntu1604
@@ -66,7 +65,7 @@ jobs:
6665
python-version: '3.x'
6766

6867
- name: Install test dependencies
69-
run: pip install 'ansible${{ matrix.ansible-version }}' molecule[docker] docker
68+
run: pip install 'ansible${{ matrix.ansible-version }}' molecule-plugins[docker] docker
7069

7170
- name: Run Molecule tests
7271
run: |

handlers/main.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,62 @@
11
# handlers file
22
---
33
- name: new aliases
4-
command: >
4+
ansible.builtin.command: >
55
newaliases
66
when: postfix_default_database_type != 'regexp'
7+
changed_when: true
78

89
- name: new virtual aliases
9-
command: >
10+
ansible.builtin.command: >
1011
postmap {{ postfix_default_database_type }}:{{ postfix_virtual_aliases_file }}
1112
when: postfix_default_database_type != 'regexp'
13+
changed_when: true
1214

1315
- name: postmap sasl_passwd
14-
command: >
16+
ansible.builtin.command: >
1517
postmap {{ postfix_default_database_type }}:{{ postfix_sasl_passwd_file }}
1618
when: postfix_default_database_type != 'regexp'
19+
changed_when: true
1720

1821
- name: postmap sender_canonical_maps
19-
command: >
22+
ansible.builtin.command: >
2023
postmap {{ postfix_sender_canonical_maps_database_type }}:{{ postfix_sender_canonical_maps_file }}
2124
when: postfix_sender_canonical_maps_database_type != 'regexp'
25+
changed_when: true
2226

2327
- name: postmap recipient_canonical_maps
24-
command: >
28+
ansible.builtin.command: >
2529
postmap {{ postfix_recipient_canonical_maps_database_type }}:{{ postfix_recipient_canonical_maps_file }}
2630
when: postfix_recipient_canonical_maps_database_type != 'regexp'
31+
changed_when: true
2732

2833
- name: postmap transport_maps
29-
command: >
34+
ansible.builtin.command: >
3035
postmap {{ postfix_transport_maps_database_type }}:{{ postfix_transport_maps_file }}
3136
when: postfix_transport_maps_database_type != 'regexp'
37+
changed_when: true
3238

3339
- name: postmap sender_dependent_relayhost_maps
34-
command: >
40+
ansible.builtin.command: >
3541
postmap {{ postfix_default_database_type }}:{{ postfix_sender_dependent_relayhost_maps_file }}
3642
when: postfix_default_database_type != 'regexp'
43+
changed_when: true
3744

3845
- name: postmap generic
39-
command: >
46+
ansible.builtin.command: >
4047
postmap {{ postfix_smtp_generic_maps_database_type }}:{{ postfix_smtp_generic_maps_file }}
4148
when: postfix_smtp_generic_maps_database_type != 'regexp'
49+
changed_when: true
4250

4351
- name: remove pid
44-
file:
52+
ansible.builtin.file:
4553
path: "~postfix/pid/master.pid"
4654
state: absent
4755
listen: restart postfix
4856
when: is_docker_guest
4957

5058
- name: restart service
51-
service:
59+
ansible.builtin.service:
5260
name: postfix
5361
state: restarted
5462
listen: restart postfix

tasks/main.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# tasks file
22
---
33
- name: facts | set
4-
set_fact:
4+
ansible.builtin.set_fact:
55
is_docker_guest: "{{ ansible_virtualization_role | default('host') == 'guest' and ansible_virtualization_type | default('none') == 'docker' }}"
66
tags:
77
- configuration
88
- postfix
99
- postfix-facts
1010

1111
- name: configure debconf
12-
debconf:
12+
ansible.builtin.debconf:
1313
name: "{{ item.name }}"
1414
question: "{{ item.question }}"
1515
value: "{{ item.value }}"
@@ -21,7 +21,7 @@
2121
- postfix-install
2222

2323
- name: install package
24-
apt:
24+
ansible.builtin.apt:
2525
name: "{{ postfix_install }}"
2626
state: "{{ apt_install_state | default('latest') }}"
2727
update_cache: true
@@ -32,7 +32,7 @@
3232
- postfix-install
3333

3434
- name: configure mailname
35-
template:
35+
ansible.builtin.template:
3636
src: "{{ postfix_mailname_file.lstrip('/') }}.j2"
3737
dest: "{{ postfix_mailname_file }}"
3838
owner: root
@@ -45,7 +45,7 @@
4545
- postfix-mailname
4646

4747
- name: update configuration file
48-
template:
48+
ansible.builtin.template:
4949
src: "{{ postfix_main_cf.lstrip('/') }}.j2"
5050
dest: "{{ postfix_main_cf }}"
5151
owner: root
@@ -58,7 +58,7 @@
5858
- postfix-configuration
5959

6060
- name: configure sasl username/password
61-
template:
61+
ansible.builtin.template:
6262
src: "{{ postfix_sasl_passwd_file.lstrip('/') }}.j2"
6363
dest: "{{ postfix_sasl_passwd_file }}"
6464
owner: root
@@ -77,7 +77,7 @@
7777
- postfix-sasl-passwd
7878

7979
- name: configure aliases
80-
template:
80+
ansible.builtin.template:
8181
src: "{{ postfix_aliases_file.lstrip('/') }}.j2"
8282
dest: "{{ postfix_aliases_file }}"
8383
owner: root
@@ -92,7 +92,7 @@
9292
- postfix-aliases
9393

9494
- name: check if aliases.db exists
95-
stat:
95+
ansible.builtin.stat:
9696
path: "{{ postfix_aliases_file }}.db"
9797
register: _aliasesdb
9898
changed_when: not _aliasesdb.stat.exists
@@ -106,7 +106,7 @@
106106
- postfix-aliases
107107

108108
- name: configure virtual aliases
109-
lineinfile:
109+
ansible.builtin.lineinfile:
110110
dest: "{{ postfix_virtual_aliases_file }}"
111111
regexp: '^{{ item.virtual | regex_escape }}\s.*'
112112
line: '{{ item.virtual }} {{ item.alias }}'
@@ -125,7 +125,7 @@
125125
- postfix-virtual-aliases
126126

127127
- name: configure sender canonical maps
128-
lineinfile:
128+
ansible.builtin.lineinfile:
129129
dest: "{{ postfix_sender_canonical_maps_file }}"
130130
regexp: '^{{ item.sender | regex_escape }}\s.*'
131131
line: '{{ item.sender }} {{ item.rewrite }}'
@@ -144,7 +144,7 @@
144144
- postfix-sender-canonical-maps
145145

146146
- name: configure recipient canonical maps
147-
lineinfile:
147+
ansible.builtin.lineinfile:
148148
dest: "{{ postfix_recipient_canonical_maps_file }}"
149149
regexp: '^{{ item.recipient | regex_escape }}\s.*'
150150
line: '{{ item.recipient }} {{ item.rewrite }}'
@@ -163,7 +163,7 @@
163163
- postfix-recipient-canonical-maps
164164

165165
- name: configure transport maps
166-
lineinfile:
166+
ansible.builtin.lineinfile:
167167
dest: "{{ postfix_transport_maps_file }}"
168168
regexp: '^{{ item.pattern | regex_escape }}\s.*'
169169
line: '{{ item.pattern }} {{ item.result }}'
@@ -182,7 +182,7 @@
182182
- postfix-transport-maps
183183

184184
- name: configure sender dependent relayhost maps
185-
lineinfile:
185+
ansible.builtin.lineinfile:
186186
dest: "{{ postfix_sender_dependent_relayhost_maps_file }}"
187187
regexp: '^{{ item.pattern | regex_escape }}\s.*'
188188
line: '{{ item.pattern }} {{ item.result }}'
@@ -201,7 +201,7 @@
201201
- postfix-sender-dependent-relayhost-maps
202202

203203
- name: configure generic table
204-
lineinfile:
204+
ansible.builtin.lineinfile:
205205
dest: "{{ postfix_smtp_generic_maps_file }}"
206206
regexp: '^{{ item.pattern | regex_escape }}\s.*'
207207
line: '{{ item.pattern }} {{ item.result }}'
@@ -220,7 +220,7 @@
220220
- postfix-generic-table
221221

222222
- name: configure header checks
223-
template:
223+
ansible.builtin.template:
224224
src: "{{ postfix_header_checks_file.lstrip('/') }}.j2"
225225
dest: "{{ postfix_header_checks_file }}"
226226
owner: root
@@ -234,7 +234,7 @@
234234
- postfix-header-checks-table
235235

236236
- name: start and enable service
237-
service:
237+
ansible.builtin.service:
238238
name: postfix
239239
state: "{{ service_default_state | default('started') }}"
240240
enabled: "{{ service_default_enabled | default(true) | bool }}"

0 commit comments

Comments
 (0)