junos_install_config 替换模块是什么?
What is the junos_install_config replacement module?
当在 playbook 中使用来自 Juniper.junos
角色的 junos_instal_config
模块时,例如:
---
- 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
运行 剧本 returns 以下弃用警告:
[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 设备?
您可以尝试 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"
当在 playbook 中使用来自 Juniper.junos
角色的 junos_instal_config
模块时,例如:
---
- 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
运行 剧本 returns 以下弃用警告:
[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 设备?
您可以尝试 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"