本文共 895 字,大约阅读时间需要 2 分钟。
pip3 install junos-ezncpip3 install jxmlease
ansible-galaxy install juniper.junos或者是ansible-galaxy install Juniper.junos大小写都行反正你这里怎么安装的下面就怎么引用
roles: - role: juniper.junos
主机清单
[junos]ex2300 ansible_host:#根据自你的设备地址来填[junos:vars]ansible_connection: localansible_network_os: junos#这里一定要声明操作系统哦ansible_user: #根据自你的设备地址来填ansible_ssh_pass: #根据自你的设备地址来填
输出当前juniper设备的配置
---- name: get junos configuration hosts: all gather_facts: no roles: - Juniper.junos tasks: - name: show juniper_junos_command: provider: host: "XXXX" commands: - "show configuration | display set" register: result - name: debug output debug: msg: "{ {result}}"
根据实例,可以可以参考一下Juniper的官方文档中的其他模块:
转载地址:http://cqugn.baihongyu.com/