On Monday, 10 December 2018 15:32:53 CET Robert wrote:
>
> - name: Force password change for user test-user
> command: "chage -d 0 {{
item.name }}"
> with_items: "{{ users }}"
>
> +++++++++++++++++++++++++++++++
> The first task works fine and creates the users in the user.yml file.
> However, when it gets to the password force change I get the following
> error:
>
> ERROR! Syntax Error while loading YAML.
> mapping values are not allowed in this context
>
> The error appears to have been in
> '/home/rkruck/ansible-playbooks/test.yml': line 19, column 16, but may
> be elsewhere in the file depending on the exact syntax problem.
>
> The offending line appears to be:
>
> - name: Force password change for user test-user
> command: "chage -d 0 {{
item.name }}"
> ^ here
You have indented command to far, remove two spaces so it align at the same level as name and with_items.