首页 文章

ansible ERROR!剧本中有冲突的行动声明

提问于
浏览
0

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

错误似乎出现在'/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}}"

1 回答

  • 0

    缺少破折号:

    - 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
    

相关问题