Skip to content

Commit 60c113f

Browse files
committed
Make templating work with Jinja2 >= 3.0.0
Without this change you'll see the following error: TASK [infrastructure/johanmeiring.sftp-server : SFTP-Server | Correct ownership and permission of home directories] ************************************ fatal: [sftp-server]: FAILED! => msg: 'template error while templating string: expected token '','', got ''integer''. String: {{ item.mode | default(0750) }}' See pallets/jinja#1171
1 parent 171ce2c commit 60c113f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tasks/main.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
path: "{{ item.home }}"
9191
owner: root
9292
group: "{{ item.group | default(sftp_group_name) }}"
93-
mode: "{{ item.mode | default(0750) }}"
93+
mode: "{{ item.mode | default('0750') }}"
9494
with_items: "{{ _sftp_users }}"
9595

9696
# Install all relevant public keys.
@@ -118,7 +118,7 @@
118118
path: "{{ item[0].home }}/{{ item[1].name | default(item[1]) }}"
119119
owner: "{{ item[0].name }}"
120120
group: "{{ item[0].group | default(item[0].name) }}"
121-
mode: "{{ item[1].mode | default(0750) }}"
121+
mode: "{{ item[1].mode | default('0750') }}"
122122
state: directory
123123
with_nested:
124124
- "{{ _sftp_users }}"
@@ -130,7 +130,7 @@
130130
path: "{{ item[0].home }}/{{ item[1].name | default(item[1]) }}"
131131
owner: "{{ item[0].name }}"
132132
group: "{{ item[0].group | default(item[0].name) }}"
133-
mode: "{{ item[1].mode | default(0750) }}"
133+
mode: "{{ item[1].mode | default('0750') }}"
134134
state: directory
135135
with_subelements:
136136
- "{{ _sftp_users }}"

0 commit comments

Comments
 (0)