test.yml
---
- name: CloudEngine
hosts: route
connection: network_cli
gather_facts: no
vars:
cli:
hosts: "{{inventory_hostname}}"
port: "{{ansible_ssh_port}}"
username: "{{ansible_ssh_user}}"
password: "{{ansible_ssh_pass}}"
transport: cli
tasks:
- name: "save config"
community.network.ce_config:
save: yes
provider: "{{cli}}"
register: output
配置管理:Ansible CloudEngine 设备配置保存
该篇博客介绍了如何使用Ansible的`community.network.ce_config`模块来连接CloudEngine设备,并执行配置保存操作。配置文件中定义了连接信息,包括主机名、端口、用户名和密码,然后在任务部分调用模块进行配置的保存,并将结果注册为变量`output`。
247

被折叠的 条评论
为什么被折叠?



