หากfirewall_allowed_ports
อยู่ใน:
- name: port {{ item }} allowed in firewall
ufw:
rule: allow
port: "{{ item }}"
proto: tcp
with_items:
- 22
- "{{ firewall_allowed_ports }}"
ไม่ได้กำหนดดังนั้นข้อผิดพลาดนี้เกิดขึ้น:
fatal: [host.example.com]: FAILED! => {"failed": true, "msg": "the field 'args'
has an invalid value, which appears to include a variable that is undefined.
พยายามแก้ไขปัญหา
"{{ firewall_allowed_ports | }}"
ผลลัพธ์ใน:
fatal: [host.example.com]: FAILED! => {"failed": true, "msg": "template error
while templating string: expected token 'name', got 'end of print statement'.
String: {{ firewall_allowed_ports | }}"}