Hi Please see the below command lines. Raw command line highlighted below
cannot work.
After entering the command, it shows some error message. It looks like the
access is refused. Did I missed some things? The routers is configured with
ssh correctly.
Thank you
--------------------------------
sudo nano hosts
[lab-hosts]
192.168.1.[11:13]
sudo nano ansible.cfg
[defaults]
inventory = ./hosts
host_key checking = false
timeout = 5
mkdir group_vars
cd /group_vars
sudo nano devices.yml
ansible_network_os: ios
*ansible lab-hosts -m raw -a "show run" -u ansible -k | grep 'hostname\|
system mtu'*
SSH password:
[DEPRECATION WARNING]: The TRANSFORM_INVALID_GROUP_CHARS settings is set to
allow bad characters in group names by default,
this will change, but still be user configurable on deprecation. This
feature will be removed in version 2.10. Deprecation
warnings can be disabled by setting deprecation_warnings=False in
ansible.cfg.
[WARNING]: Invalid characters were found in group names but not replaced,
use -vvvv to see details
192.168.1.11 | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: ssh: connect to host
192.168.1.11 port 22: Connection refused",
"unreachable": true
}
192.168.1.12 | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: ssh: connect to host
192.168.1.12 port 22: Connection timed out",
"unreachable": true
}
192.168.1.13 | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: ssh: connect to host
192.168.1.13 port 22: Connection timed out",
"unreachable": true
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/fb92eb4b-15ed-46ce-86e3-f27b094cda0an%40googlegroups.com.