0

我正在尝试使用 ansible 将配置推送到瞻博网络设备上。我正在使用下面的剧本,使用 netconf 进行连接。我收到一条错误消息:无法加载配置:ConfigLoadError(严重性:错误,坏元素:设置,消息:错误:语法错误)

    ---
    - name: Load merge config
      connection: local
      gather_facts: no
      hosts: juniper

      roles:
       - Juniper.junos

      tasks:
      - name: Checking NETCONF connectivity
        wait_for: host={{ inventory_hostname }} port=830

      - name: Push config
        junos_install_config:
         host={{ inventory_hostname }}
         file=push.conf 
         replace_config=true

我的配置文件包含所有设置命令。

4

1 回答 1

0

谢谢,现在可以了。实际上我的配置文件是带有设置命令的,我所要做的就是使用文件名作为 push.set。并且还必须在主机下包含用户。最终奏效的剧本。

    ---
    - hosts: Juniper
      gather_facts: no
      connection: local

      roles:
       - Juniper.junos

      tasks:
      - name: Push config
        junos_install_config:
         host={{ ansible_ssh_host }}          
         user={{ ansible_user }}
         file=push.set
于 2016-03-28T18:09:29.697 回答