Ansible 不可能的错误!剧本中冲突的动作陈述

Ansible 不可能的错误!剧本中冲突的动作陈述,ansible,Ansible,我试图运行一个剧本,并得到如下语法错误,需要了解我的错误是:错误!相互冲突的行动声明 错误似乎出现在“/etc/ansible/chk_ddboost.yml”中:第4行第7列,但可能是 根据确切的语法问题,在文件中的其他位置 tasks: - name: ddboost plugin check ^ here --- - hosts: netbackup tasks: - name: ddboost plugin check stat: path: /usr/openv/

我试图运行一个剧本,并得到如下语法错误,需要了解我的错误是:错误!相互冲突的行动声明

错误似乎出现在“/etc/ansible/chk_ddboost.yml”中:第4行第7列,但可能是 根据确切的语法问题,在文件中的其他位置

tasks:
- name: ddboost plugin check
  ^ here

---
- hosts: netbackup
  tasks:
- name: ddboost plugin check
  stat:
    path: /usr/openv/lib/ost-plugins/libstspiDataDomain.so
  register: stat_result
  fail: msg="DDBoost not installed on system"
  when: stat_result.stat.exists = False

- name: run command as root
  become: true
  become_method: sudo
  become_user: root
  command: "/usr/openv/netbackup/bin/admincmd/bpstsinfo -pi -stype DataDomain"

- name: show output
  debug: msg="{{result.stdout_lines}}"
缺少破折号:

- name: ddboost plugin check
  stat:
    path: /usr/openv/lib/ost-plugins/libstspiDataDomain.so
  register: stat_result

- fail: msg="DDBoost not installed on system"
  when: not stat_result.stat.exists = False

请修复代码段中任务的缩进,因为这样您应该会收到另一条错误消息。谢谢您,这是正确的。