【问题标题】:What is the junos_install_config replacement module?junos_install_config 替换模块是什么?
【发布时间】:2020-02-01 14:46:24
【问题描述】:

当在 playbook 中使用 Juniper.junos 角色中的 junos_instal_config 模块作为 ansible 时,例如:

---
- 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 设备?

【问题讨论】:

    标签: ansible ansible-role juniper junos-automation


    【解决方案1】:

    您可以尝试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

    【讨论】:

      猜你喜欢
      • 2015-11-09
      • 2020-10-27
      • 2023-03-27
      • 2018-07-28
      • 1970-01-01
      • 2019-03-09
      • 1970-01-01
      • 2011-08-11
      相关资源
      最近更新 更多