`Unexpected templating type error occurred on ({{ base_port + port_offset }}): unsupported operand type(s) for +: 'int' and 'str'`
IntermediateTroubleshootingYAML, Syntax and Jinja2 Errors
Answer
Likely causes → One of the operands is a string. It came from -e port_offset=10, an AWX survey text field, a lookup('env', ...) or stdout.
Fix →
listen_port: "{{ base_port | int + port_offset | int }}"
For lists, + needs a list on both sides: "{{ list_a + [single_item] }}".
Prevent → Cast at the boundary where data enters the playbook (| int, | bool, | from_json), and declare type: int in meta/argument_specs.yml.
More on YAML, Syntax and Jinja2 Errors
`Syntax Error while loading YAML. mapping values are not allowed in this context`Beginner`found character '\t' that cannot start any token`Beginner`ERROR! conflicting action statements: ansible.builtin.copy, dest`IntermediateAnsible says `This one looks easy to fix. It seems that there is a value started with a quote, and the YAML parser is expecting to see the line ended with the same kind of quote.`Beginner`We could be wrong, but this one looks like it might be an issue with missing quotes. Always quote template expression brackets when they start a value.`Beginner`ERROR! A malformed block was encountered while loading tasks: {...} should be a list or None but is <class 'ansible.parsing.yaml.objects.AnsibleMapping'>`Intermediate