谁能在 ansible 剧本中看到我做错了什么?
Can anyone see what I am doing wrong in the ansible playbook?
使用 ansible lint 时出现了以下奇怪的错误,我这辈子都无法弄清楚我们做错了什么,这可能是非常愚蠢的事情,但你走了。
ansible-lint -p disable-beats.yml
Couldn't parse task at disable-beats.yml:5 (conflicting action statements: systemd, __line__
The error appears to be in '<unicode string>': line 5, column 7, but may
be elsewhere in the file depending on the exact syntax problem.
(could not open file to display line))
{ 'name': 'disable auditbeats',
'skipped_rules': [],
'systemd': { '__file__': 'disable-beats.yml',
'__line__': 7,
'enabled': False,
'name': 'auditbeat'}}
以下是用linter检查的文件内容:
---
- hosts: linuxservers
tasks:
- name: disable auditbeats
systemd:
name: auditbeat
enabled: no
那是 known issue with ansible-lint
; upgrading to a more recent version such as 5.0.12 将使它消失。如果它不适合您的情况,您可以对该问题发表评论或打开回归,届时您应该提供您正在使用的版本
使用 ansible lint 时出现了以下奇怪的错误,我这辈子都无法弄清楚我们做错了什么,这可能是非常愚蠢的事情,但你走了。
ansible-lint -p disable-beats.yml
Couldn't parse task at disable-beats.yml:5 (conflicting action statements: systemd, __line__
The error appears to be in '<unicode string>': line 5, column 7, but may
be elsewhere in the file depending on the exact syntax problem.
(could not open file to display line))
{ 'name': 'disable auditbeats',
'skipped_rules': [],
'systemd': { '__file__': 'disable-beats.yml',
'__line__': 7,
'enabled': False,
'name': 'auditbeat'}}
以下是用linter检查的文件内容:
---
- hosts: linuxservers
tasks:
- name: disable auditbeats
systemd:
name: auditbeat
enabled: no
那是 known issue with ansible-lint
; upgrading to a more recent version such as 5.0.12 将使它消失。如果它不适合您的情况,您可以对该问题发表评论或打开回归,届时您应该提供您正在使用的版本