Answer the question
In order to leave comments, you need to log in
How to solve ansible-lint error?
Ansible-lint throws the following error when running GitHub Actions:
==> Linting /github/workspace/playbook.yml…
Couldn't parse task at /github/workspace/roles/misc/tasks/configure/configure-debian.yml:2 (conflicting action statements: hostname, __line__
The error appears to be in '<unicode string>': line 2, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
(could not open file to display line))
{ 'hostname': { '__file__': '/github/workspace/roles/misc/tasks/configure/configure-debian.yml',
'__line__': 4,
'name': '{{ hostname }}'},
'name': 'Setting hostname'}
---
- name: Setting hostname
hostname:
name: "{{ hostname }}"
Answer the question
In order to leave comments, you need to log in
{{ hostname }}
it is an ansible built-in variable. Try to name the variable differently or redefine something else, like
- name: Setting hostname
hostname:
name: "{{ inventory_hostname }}"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question