Closed xqxrrz1ge2 closed 7 years ago
can somebody help, please?
@ticonci please try:
---
- name: "sample book"
hosts: SIS
connection: local
vars:
cli:
host: '{{ inventory_hostname }}'
port: 22
username: telnet
password: Huawei@123
transport: cli
tasks:
- name: run display version on remote devices
ce_command:
commands: display version
provider: "{{ cli }}"
it works. thx a lot
I am using this sample playbook:
It works well when connecting a single CE switch. But how can I connect to a group of switches which I already defined in
/etc/ansible/hosts
in the first place? Assuming I have got group which is called SIS, when I replace the '172.19.2.1' with 'SIS', ansible is actually trying to connect 'SIS', but not the IP addresses listing in/etc/ansible/hosts
. Plz help!