Ansible Network
约 1 分钟阅读
EdgeRouter 配置
# 添加 ssh key
scp admin_rsa.pub [email protected]:/tmp/key
ssh [email protected]
configure
# key 需要有说明否则会说不合法
loadkey admin /tmp/key
commit
save
exitedgerouter:
hosts:
er-1:
ansible_host: 192.168.1.1
ansible_user: admin
ansible_network_os: edgeos
connection: network_clinet-facts.yaml
- name: Network facts
connection: network_cli
gather_facts: false
hosts: edgerouter
tasks:
- name: Get facts
edgeos_facts:
gather_subset: all
- name: Display the config
debug:
msg:
- 'Hostname : {{ansible_net_hostname}}'
- 'Model : {{ansible_net_model}} v{{ ansible_net_version }}'
- 'Serial : {{ansible_net_serialnum}}'ansible -m ping edgerouter
ansible-playbook net-facts.yamlsocket_path must be a value
关联信息
反向链接、本文链接的其他页面和外部资料。
参考资料
GitHub1 条
- claytono/edgerouter-ansiblegithub.com/claytono/edgerouter-ansible
其他外链1 条
- docs.ansible.com/ansible/2.9/modules/list_of_network_modules.htmldocs.ansible.com/ansible/2.9/modules/list_of_network_modules.html