Ansible 与cisco设备兼容

Ansible 与cisco设备兼容,ansible,cisco-ios,Ansible,Cisco Ios,我尝试通过以下任务在cisco设备上测试我的审计活动: tasks: - name: 1.1.1 Enable 'aaa new-model' (Scored) ios_command: commands: show running-config | incl aaa new-model register: output1 - name: 1.1.1 Check results delegate_to: localhost

我尝试通过以下任务在cisco设备上测试我的审计活动:

  tasks:
    - name: 1.1.1 Enable 'aaa new-model' (Scored)
      ios_command:
        commands: show running-config | incl aaa new-model
      register: output1
    - name: 1.1.1 Check results
      delegate_to: localhost
      lineinfile:
        path: /tmp/Summary.txt
        line: "1.1.1|Fail"
      when: output1.stdout is 'no aaa new-model'
    - name: 1.1.1 Check results
      delegate_to: localhost
      lineinfile:
        path: /tmp/Summary.txt
        line: "1.1.1|Pass"
      when: output1.stdout is not 'no aaa new-model'
此活动将运行ios命令并注册值,然后我将检查条件并将结果粘贴到本地主机(linux) 但是我犯了这个错误

FAILED! => {"msg": "The conditional check 'output1.stdout is 'no aaa new-model'' failed. The error was: template error while templating string: expected token 'name', got 'string'. String: {% if output1.stdout is 'no aaa new-model' %} True {% else %} False {% endif %}\n\nThe error appears to be in '/etc/ansible/Cisco/1.1.yaml': line 15, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n      register: output1\n    - name: 1.1.1 Check results\n      ^ here\n"}
谁能告诉我发生了什么事?
另外,我的ansible版本是2.9.3

存储在“output1”变量中的结果包含在“output1.stdout[0]”中

“output1.stdout”是一个列表,“output1.stdout[0]是您要查找的字符串