0

在剧本中使用角色中的junos_instal_config模块时,Juniper.junos例如:

---
- name: Send Set Files to Different Devices
  hosts: all
  roles:
    - Juniper.junos
  connection: local
  gather_facts: no

  tasks:
    - name: " Install vMX1 File"
      junos_install_config:
              host = " {{ inventory_hostname }}"
              file = " /home/ubuntu/resources/vMX1.set"
              overwrite = false

运行 playbook 会返回以下弃用警告:

[DEPRECATION WARNING]: junos_install_config is kept for backwards compatibility but usage is discouraged. The module documentation details page may explain more about this rationale.. This feature will be
removed in a future release. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.

但是阅读有关该模块的文档,我似乎无法找到取代它的内容。谁能告诉我现在可以在以后的版本中使用哪个模块将“.set”文件发送和安装到 Junos 设备?

4

1 回答 1

0

您可以尝试juniper_junos_config使用模块来推送或检索配置。

  tasks:
    - name: Load configuration from a local file and commit
      juniper_junos_config:
        load: "merge"
        src: "build_conf/{{ inventory_hostname }}/junos.conf"

查看文档以获取更多详细信息。 https://www.juniper.net/documentation/en_US/junos-ansible/topics/topic-map/junos-ansible-configuration-loading-committing.html#task-configuration-load-file

于 2019-10-04T13:55:06.553 回答